Skip to content

Commit 300081c

Browse files
Merge branch 'dev' into main
2 parents 7177082 + 5003a73 commit 300081c

18 files changed

Lines changed: 435 additions & 270 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,5 @@ doc/api/
6262
*.js_
6363
*.js.deps
6464
*.js.map
65+
66+
Inno_Setup_Script.iss

lib/components/console_output.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ConsoleOutput extends StatelessWidget {
1212
return Expanded(
1313
child: Container(
1414
width: double.infinity,
15-
color: Theme.of(context).brightness==Brightness.light?Colors.grey[200]:Colors.grey[900],
15+
color: Theme.of(context).brightness==Brightness.light?Colors.grey[200]:Colors.black,
1616
child: SingleChildScrollView(
1717
reverse: true,
1818
scrollDirection: Axis.vertical,

lib/components/window_buttons.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ class WindowMaterialButton extends StatelessWidget {
7171
Widget build(BuildContext context) {
7272
return MaterialButton(
7373
shape: const CircleBorder(),
74-
color: Theme.of(context).brightness==Brightness.light?Colors.blue:Colors.grey[800],
74+
// color: Theme.of(context).brightness==Brightness.light?Colors.blue:Colors.grey[800],
75+
color: Theme.of(context).brightness==Brightness.light?Colors.blue:Colors.transparent,
7576
elevation: 0,
7677
minWidth: 8,
7778
hoverColor: Theme.of(context).brightness==Brightness.light?hoverColor:darkModeHoverColor,

lib/layout_widgets/PackageInfo.dart

Lines changed: 74 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -81,24 +81,47 @@ class PackageInfo extends StatelessWidget {
8181
Row(
8282
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
8383
children: [
84-
if(packageInfo['appType']==AppType.user)
85-
SimpleRectangleIconMaterialButton(
86-
buttonText: "Offload",
87-
buttonIcon: const Icon(FontAwesomeIcons.archive,color: Colors.blue,),
84+
SimpleRectangleIconMaterialButton(
85+
buttonText: "Open",
86+
buttonIcon: const Icon(Icons.open_in_new,color: Colors.blue,),
87+
onPressed: () async{
88+
int exitCode=await adbService.launchApp(packageName: packageInfo['packageName']!);
89+
if(exitCode!=0){
90+
showDialog(
91+
context: context,
92+
builder: (context)=>AlertDialog(
93+
title: const Text("Error"),
94+
content: Text("Unable to launch application!${exitCode==252?" No activity found":""}. Exit Code: $exitCode"),
95+
actions: [
96+
TextButton(
97+
onPressed: (){
98+
Navigator.pop(context);
99+
},
100+
child: const Text("OK"),
101+
)
102+
],
103+
),
104+
);
105+
}
106+
},
107+
), // if(packageInfo['appType']==AppType.user)
108+
SimpleRectangleIconMaterialButton(
109+
buttonText: "Uninstall",
110+
buttonIcon: const Icon(Icons.delete,color: Colors.blue,),
88111
onPressed: (){
89112
showDialog(
90113
context: context,
91114
builder: (context)=>PromptDialog(
92-
title: "Offload ${packageInfo['packageName']!}?",
93-
contentText: "This will uninstall the app while retaining its data. Yes that's right! Upon re-installation, the app will continue from where it was left off (Similar to what offloading in iOS does). If you want to remove the data completely, install the app again and uninstall normally.",
115+
title: packageInfo['packageName']!,
116+
contentText: packageInfo['appType']==AppType.system?"This is a system app and uninstalling it will only uninstall for the active user. Proceed?":"Do you want to uninstall this app?",
94117
onConfirm: () async{
95-
if(await adbService.uninstallApp(packageName: packageInfo['packageName']!,keepData: true)!=0){
118+
if(await performUninstall()!=0){
96119
await showDialog(
97120
context: context,
98121
builder: (context)=>AlertDialog(
99122
title: const Text("Error",style: TextStyle(
100-
color: Colors.blue,
101-
fontWeight: FontWeight.w600
123+
color: Colors.blue,
124+
fontWeight: FontWeight.w600
102125
),),
103126
content: const Text("An error occurred"),
104127
actions: [
@@ -107,7 +130,7 @@ class PackageInfo extends StatelessWidget {
107130
Navigator.pop(context);
108131
},
109132
child: const Text("OK",style: TextStyle(
110-
color: Colors.blue
133+
color: Colors.blue
111134
),),
112135
),
113136
],
@@ -139,47 +162,6 @@ class PackageInfo extends StatelessWidget {
139162
);
140163
},
141164
),
142-
// if(packageInfo['appType']==AppType.user)
143-
SimpleRectangleIconMaterialButton(
144-
buttonText: "Uninstall",
145-
buttonIcon: const Icon(Icons.delete,color: Colors.blue,),
146-
onPressed: (){
147-
showDialog(
148-
context: context,
149-
builder: (context)=>PromptDialog(
150-
title: packageInfo['packageName']!,
151-
contentText: packageInfo['appType']==AppType.system?"This is a system app and uninstalling it will only uninstall for the active user. Proceed?":"Do you want to uninstall this app?",
152-
onConfirm: () async{
153-
if(await performUninstall()!=0){
154-
await showDialog(
155-
context: context,
156-
builder: (context)=>AlertDialog(
157-
title: const Text("Error",style: TextStyle(
158-
color: Colors.blue,
159-
fontWeight: FontWeight.w600
160-
),),
161-
content: const Text("An error occurred"),
162-
actions: [
163-
TextButton(
164-
onPressed: (){
165-
Navigator.pop(context);
166-
},
167-
child: const Text("OK",style: TextStyle(
168-
color: Colors.blue
169-
),),
170-
),
171-
],
172-
),
173-
);
174-
}else{
175-
onUninstallComplete();
176-
}
177-
Navigator.pop(context);
178-
},
179-
),
180-
);
181-
},
182-
),
183165
],
184166
),
185167
Divider(
@@ -222,6 +204,47 @@ class PackageInfo extends StatelessWidget {
222204
},
223205
),
224206
),
207+
if(packageInfo['appType']==AppType.user)
208+
SimpleRectangleIconMaterialButton(
209+
buttonText: "Offload",
210+
buttonIcon: const Icon(FontAwesomeIcons.archive,color: Colors.blue,),
211+
onPressed: (){
212+
showDialog(
213+
context: context,
214+
builder: (context)=>PromptDialog(
215+
title: "Offload ${packageInfo['packageName']!}?",
216+
contentText: "This will uninstall the app while retaining its data. Yes that's right! Upon re-installation, the app will continue from where it was left off (Similar to what offloading in iOS does). If you want to remove the data completely, install the app again and uninstall normally.",
217+
onConfirm: () async{
218+
if(await adbService.uninstallApp(packageName: packageInfo['packageName']!,keepData: true)!=0){
219+
await showDialog(
220+
context: context,
221+
builder: (context)=>AlertDialog(
222+
title: const Text("Error",style: TextStyle(
223+
color: Colors.blue,
224+
fontWeight: FontWeight.w600
225+
),),
226+
content: const Text("An error occurred"),
227+
actions: [
228+
TextButton(
229+
onPressed: (){
230+
Navigator.pop(context);
231+
},
232+
child: const Text("OK",style: TextStyle(
233+
color: Colors.blue
234+
),),
235+
),
236+
],
237+
),
238+
);
239+
}else{
240+
onUninstallComplete();
241+
}
242+
Navigator.pop(context);
243+
},
244+
),
245+
);
246+
},
247+
),
225248
if(appCompilationSupported(device.androidAPILevel))
226249
Tooltip(
227250
message: "You can opt to trade speed for space or vice versa. Applications may take up less or more space depending on your choice",

lib/main.dart

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import 'package:adb_gui/services/shared_prefs.dart';
33
import 'package:bitsdojo_window/bitsdojo_window.dart';
44
import 'package:flutter/foundation.dart';
55
import 'package:flutter/material.dart';
6+
import 'package:flutter/scheduler.dart';
7+
import 'package:flutter_acrylic/flutter_acrylic.dart';
68
import 'utils/vars.dart';
79
import 'dart:io';
10+
import 'services/platform_services.dart';
811
import 'package:google_fonts/google_fonts.dart';
912

1013
void main() async {
@@ -19,31 +22,86 @@ void main() async {
1922
}
2023
}
2124

25+
WidgetsFlutterBinding.ensureInitialized();
26+
27+
await Window.initialize();
28+
29+
ThemeMode themeModePreference=await getThemeModePreference();
30+
31+
if(Platform.isWindows){
32+
await Window.hideWindowControls();
33+
if(isWindows11()){
34+
await Window.setEffect(
35+
effect: WindowEffect.mica,
36+
dark: themeModePreference==ThemeMode.dark?true:themeModePreference==ThemeMode.light?false:SchedulerBinding.instance!.window.platformBrightness==Brightness.dark
37+
);
38+
}else{
39+
await Window.setEffect(
40+
effect: WindowEffect.solid,
41+
color: const Color(0xFF212121),
42+
);
43+
}
44+
}else if(Platform.isLinux){
45+
await Window.setEffect(
46+
effect: WindowEffect.solid,
47+
color: themeModePreference==ThemeMode.dark?const Color(0xFF212121):themeModePreference==ThemeMode.light?Colors.white70:SchedulerBinding.instance!.window.platformBrightness==Brightness.dark?const Color(0xFF212121):Colors.white70,
48+
);
49+
}
50+
2251
runApp(MaterialApp(
23-
themeMode: await getThemeModePreference(),
52+
themeMode: themeModePreference,
2453
theme: ThemeData(
2554
primaryColor: Colors.blue,
55+
scaffoldBackgroundColor: Colors.transparent,
2656
textTheme: TextTheme(
2757
headline1: GoogleFonts.quicksand(),
2858
headline2: GoogleFonts.quicksand(),
2959
headline3: GoogleFonts.quicksand(color: Colors.blue,fontSize: 40,),
3060
headline4: GoogleFonts.quicksand(),
3161
headline5: GoogleFonts.quicksand(color: Colors.blue,fontSize: 25,fontWeight: FontWeight.w600),
32-
headline6: GoogleFonts.quicksand(fontSize: 20,fontWeight: FontWeight.w500),
62+
headline6: GoogleFonts.quicksand(fontSize: 20,fontWeight: FontWeight.w500,),
3363
subtitle1: GoogleFonts.quicksand(fontSize: 15),
3464
subtitle2: GoogleFonts.quicksand(),
3565
bodyText1: GoogleFonts.quicksand(),
3666
bodyText2: GoogleFonts.quicksand(),
3767
button: GoogleFonts.quicksand(),
3868
caption: GoogleFonts.quicksand(),
3969
),
70+
dialogTheme: DialogTheme(
71+
titleTextStyle: GoogleFonts.quicksand(
72+
fontSize: 20,
73+
color: Colors.blue,
74+
fontWeight: FontWeight.w500,
75+
),
76+
)
4077
),
4178
darkTheme: ThemeData.dark().copyWith(
79+
scaffoldBackgroundColor: Platform.isLinux?Colors.black26:Colors.transparent,
4280
primaryColor: Colors.blueGrey,
81+
cardColor: Colors.transparent,
82+
popupMenuTheme: const PopupMenuThemeData(
83+
color: Color(0xFF212121)
84+
),
85+
bannerTheme: const MaterialBannerThemeData(
86+
backgroundColor: Color(0xFF212121)
87+
),
88+
appBarTheme: const AppBarTheme(
89+
backgroundColor: Colors.transparent,
90+
),
4391
listTileTheme: const ListTileThemeData(
4492
textColor: Colors.white,
4593
iconColor: Colors.blue,
4694
),
95+
drawerTheme: DrawerThemeData(
96+
backgroundColor: Colors.grey[900],
97+
),
98+
dialogBackgroundColor: Colors.grey[900],
99+
snackBarTheme: SnackBarThemeData(
100+
backgroundColor: Colors.grey[900],
101+
contentTextStyle: const TextStyle(
102+
color: Colors.white
103+
)
104+
),
47105
textTheme: TextTheme(
48106
headline1: GoogleFonts.quicksand(),
49107
headline2: GoogleFonts.quicksand(),

lib/screens/connection_initiation_screen.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class _ConnectionInitiationScreenState extends State<ConnectionInitiationScreen>
153153
mainAxisSize: MainAxisSize.min,
154154
children: [
155155
Text("Wi-Fi pairing code",style: TextStyle(
156-
color: Colors.grey[600]
156+
color: Colors.grey[200]
157157
),),
158158
const SizedBox(
159159
height: 8,
@@ -168,7 +168,7 @@ class _ConnectionInitiationScreenState extends State<ConnectionInitiationScreen>
168168
hintText: "000000",
169169
hintStyle: TextStyle(
170170
fontWeight: FontWeight.w400,
171-
color: Colors.grey[500]
171+
color: Colors.grey[600]
172172
),
173173
),
174174
style: const TextStyle(
@@ -181,7 +181,7 @@ class _ConnectionInitiationScreenState extends State<ConnectionInitiationScreen>
181181
),
182182
// Text("136271"),
183183
Text("IP address & Port",style: TextStyle(
184-
color: Colors.grey[500]
184+
color: Colors.grey[200]
185185
),),
186186
const SizedBox(
187187
height: 8,

lib/screens/power_controls_screen.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ class PowerControlsScreen extends StatelessWidget {
4343
deviceID: device.id,
4444
arguments: const ["reboot","recovery"],
4545
),
46+
ActionTile(
47+
leadingIcon: const Icon(Icons.system_update_rounded,color: Colors.blueAccent),
48+
titleText: "Reboot to sideload",
49+
subtitleText: "Reboot directly into recovery's sideload mode (May vary by device)",
50+
deviceID: device.id,
51+
arguments: const ["reboot","sideload"],
52+
),
4653
ActionTile(
4754
leadingIcon: const Icon(Icons.warning,color: Colors.amber),
4855
titleText: "Reboot to fastboot",

0 commit comments

Comments
 (0)