mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-31 05:23:28 +01:00 
			
		
		
		
	Added more Mass App Actions
This commit is contained in:
		| @@ -14,7 +14,7 @@ import 'package:dynamic_color/dynamic_color.dart'; | |||||||
| import 'package:device_info_plus/device_info_plus.dart'; | import 'package:device_info_plus/device_info_plus.dart'; | ||||||
|  |  | ||||||
| const String currentReleaseTag = | const String currentReleaseTag = | ||||||
|     'v0.5.5-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES |     'v0.5.6-beta'; // KEEP THIS IN SYNC WITH GITHUB RELEASES | ||||||
|  |  | ||||||
| const String bgUpdateCheckTaskName = 'bg-update-check'; | const String bgUpdateCheckTaskName = 'bg-update-check'; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -339,18 +339,141 @@ class AppsPageState extends State<AppsPage> { | |||||||
|                     ? const SizedBox() |                     ? const SizedBox() | ||||||
|                     : IconButton( |                     : IconButton( | ||||||
|                         visualDensity: VisualDensity.compact, |                         visualDensity: VisualDensity.compact, | ||||||
|  |                         onPressed: () { | ||||||
|  |                           showDialog( | ||||||
|  |                               context: context, | ||||||
|  |                               builder: (BuildContext ctx) { | ||||||
|  |                                 return AlertDialog( | ||||||
|  |                                   scrollable: true, | ||||||
|  |                                   content: Padding( | ||||||
|  |                                     padding: const EdgeInsets.only(top: 6), | ||||||
|  |                                     child: Row( | ||||||
|  |                                         mainAxisAlignment: | ||||||
|  |                                             MainAxisAlignment.spaceBetween, | ||||||
|  |                                         children: [ | ||||||
|  |                                           IconButton( | ||||||
|  |                                               onPressed: | ||||||
|  |                                                   appsProvider | ||||||
|  |                                                           .areDownloadsRunning() | ||||||
|  |                                                       ? null | ||||||
|  |                                                       : () { | ||||||
|  |                                                           showDialog( | ||||||
|  |                                                               context: context, | ||||||
|  |                                                               builder: | ||||||
|  |                                                                   (BuildContext | ||||||
|  |                                                                       ctx) { | ||||||
|  |                                                                 return AlertDialog( | ||||||
|  |                                                                   title: Text( | ||||||
|  |                                                                       'Mark ${selectedIds.length} Selected Apps as Not Installed?'), | ||||||
|  |                                                                   actions: [ | ||||||
|  |                                                                     TextButton( | ||||||
|  |                                                                         onPressed: | ||||||
|  |                                                                             () { | ||||||
|  |                                                                           Navigator.of(context) | ||||||
|  |                                                                               .pop(); | ||||||
|  |                                                                         }, | ||||||
|  |                                                                         child: const Text( | ||||||
|  |                                                                             'No')), | ||||||
|  |                                                                     TextButton( | ||||||
|  |                                                                         onPressed: | ||||||
|  |                                                                             () { | ||||||
|  |                                                                           HapticFeedback | ||||||
|  |                                                                               .selectionClick(); | ||||||
|  |                                                                           appsProvider | ||||||
|  |                                                                               .saveApps(selectedIds.map((e) { | ||||||
|  |                                                                             var a = | ||||||
|  |                                                                                 appsProvider.apps[e]!.app; | ||||||
|  |                                                                             a.installedVersion = | ||||||
|  |                                                                                 null; | ||||||
|  |                                                                             return a; | ||||||
|  |                                                                           }).toList()); | ||||||
|  |  | ||||||
|  |                                                                           Navigator.of(context) | ||||||
|  |                                                                               .pop(); | ||||||
|  |                                                                         }, | ||||||
|  |                                                                         child: const Text( | ||||||
|  |                                                                             'Yes')) | ||||||
|  |                                                                   ], | ||||||
|  |                                                                 ); | ||||||
|  |                                                               }); | ||||||
|  |                                                         }, | ||||||
|  |                                               tooltip: | ||||||
|  |                                                   'Mark Selected Apps as Not Installed', | ||||||
|  |                                               icon: const Icon( | ||||||
|  |                                                   Icons.no_cell_outlined)), | ||||||
|  |                                           IconButton( | ||||||
|  |                                               onPressed: | ||||||
|  |                                                   appsProvider | ||||||
|  |                                                           .areDownloadsRunning() | ||||||
|  |                                                       ? null | ||||||
|  |                                                       : () { | ||||||
|  |                                                           showDialog( | ||||||
|  |                                                               context: context, | ||||||
|  |                                                               builder: | ||||||
|  |                                                                   (BuildContext | ||||||
|  |                                                                       ctx) { | ||||||
|  |                                                                 return AlertDialog( | ||||||
|  |                                                                   title: Text( | ||||||
|  |                                                                       'Mark ${selectedIds.length} Selected Apps as Installed/Updated?'), | ||||||
|  |                                                                   actions: [ | ||||||
|  |                                                                     TextButton( | ||||||
|  |                                                                         onPressed: | ||||||
|  |                                                                             () { | ||||||
|  |                                                                           Navigator.of(context) | ||||||
|  |                                                                               .pop(); | ||||||
|  |                                                                         }, | ||||||
|  |                                                                         child: const Text( | ||||||
|  |                                                                             'No')), | ||||||
|  |                                                                     TextButton( | ||||||
|  |                                                                         onPressed: | ||||||
|  |                                                                             () { | ||||||
|  |                                                                           HapticFeedback | ||||||
|  |                                                                               .selectionClick(); | ||||||
|  |                                                                           appsProvider | ||||||
|  |                                                                               .saveApps(selectedIds.map((e) { | ||||||
|  |                                                                             var a = | ||||||
|  |                                                                                 appsProvider.apps[e]!.app; | ||||||
|  |                                                                             a.installedVersion = | ||||||
|  |                                                                                 a.latestVersion; | ||||||
|  |                                                                             return a; | ||||||
|  |                                                                           }).toList()); | ||||||
|  |  | ||||||
|  |                                                                           Navigator.of(context) | ||||||
|  |                                                                               .pop(); | ||||||
|  |                                                                         }, | ||||||
|  |                                                                         child: const Text( | ||||||
|  |                                                                             'Yes')) | ||||||
|  |                                                                   ], | ||||||
|  |                                                                 ); | ||||||
|  |                                                               }); | ||||||
|  |                                                         }, | ||||||
|  |                                               tooltip: | ||||||
|  |                                                   'Mark Selected Apps as Installed/Updated', | ||||||
|  |                                               icon: const Icon(Icons.done)), | ||||||
|  |                                           IconButton( | ||||||
|                                             onPressed: () { |                                             onPressed: () { | ||||||
|                                               String urls = ''; |                                               String urls = ''; | ||||||
|                                               for (var id in selectedIds) { |                                               for (var id in selectedIds) { | ||||||
|                             urls += '${appsProvider.apps[id]!.app.url}\n'; |                                                 urls += | ||||||
|  |                                                     '${appsProvider.apps[id]!.app.url}\n'; | ||||||
|                                               } |                                               } | ||||||
|                           urls = urls.substring(0, urls.length - 1); |                                               urls = urls.substring( | ||||||
|  |                                                   0, urls.length - 1); | ||||||
|                                               Share.share(urls, |                                               Share.share(urls, | ||||||
|                               subject: 'Selected App URLs from Obtainium'); |                                                   subject: | ||||||
|  |                                                       '${selectedIds.length} Selected App URLs from Obtainium'); | ||||||
|                                             }, |                                             }, | ||||||
|                                             tooltip: 'Share Selected App URLs', |                                             tooltip: 'Share Selected App URLs', | ||||||
|                                             icon: const Icon(Icons.share), |                                             icon: const Icon(Icons.share), | ||||||
|                                           ), |                                           ), | ||||||
|  |                                         ]), | ||||||
|  |                                   ), | ||||||
|  |                                 ); | ||||||
|  |                               }); | ||||||
|  |                         }, | ||||||
|  |                         tooltip: 'More', | ||||||
|  |                         icon: const Icon(Icons.more_horiz), | ||||||
|  |                       ), | ||||||
|               ], |               ], | ||||||
|             )), |             )), | ||||||
|             const VerticalDivider(), |             const VerticalDivider(), | ||||||
|   | |||||||
| @@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev | |||||||
| # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html | ||||||
| # In Windows, build-name is used as the major, minor, and patch parts | # In Windows, build-name is used as the major, minor, and patch parts | ||||||
| # of the product and file versions while build-number is used as the build suffix. | # of the product and file versions while build-number is used as the build suffix. | ||||||
| version: 0.5.5+26 # When changing this, update the tag in main() accordingly | version: 0.5.6+27 # When changing this, update the tag in main() accordingly | ||||||
|  |  | ||||||
| environment: | environment: | ||||||
|   sdk: '>=2.19.0-79.0.dev <3.0.0' |   sdk: '>=2.19.0-79.0.dev <3.0.0' | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user