mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-26 03:03:45 +01:00 
			
		
		
		
	Added App settings button
This commit is contained in:
		| @@ -1,7 +1,6 @@ | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter/services.dart'; | ||||
| import 'package:obtainium/components/generated_form.dart'; | ||||
| import 'package:obtainium/components/generated_form_modal.dart'; | ||||
| import 'package:obtainium/custom_errors.dart'; | ||||
| import 'package:obtainium/main.dart'; | ||||
| @@ -268,8 +267,9 @@ class _AppPageState extends State<AppPage> { | ||||
|                                               return row; | ||||
|                                             }).toList(); | ||||
|                                             return GeneratedFormModal( | ||||
|                                                 title: tr('additionalOptions'), | ||||
|                                                 items: items); | ||||
|                                               title: tr('additionalOptions'), | ||||
|                                               items: items, | ||||
|                                             ); | ||||
|                                           }).then((values) { | ||||
|                                         if (app != null && values != null) { | ||||
|                                           var changedApp = app.app; | ||||
| @@ -290,7 +290,15 @@ class _AppPageState extends State<AppPage> { | ||||
|                                       }); | ||||
|                                     }, | ||||
|                               tooltip: tr('additionalOptions'), | ||||
|                               icon: const Icon(Icons.settings)), | ||||
|                               icon: const Icon(Icons.edit)), | ||||
|                         if (app != null && app.installedInfo != null) | ||||
|                           IconButton( | ||||
|                             onPressed: () { | ||||
|                               appsProvider.openAppSettings(app.app.id); | ||||
|                             }, | ||||
|                             icon: const Icon(Icons.settings), | ||||
|                             tooltip: tr('settings'), | ||||
|                           ), | ||||
|                         if (app != null && settingsProvider.showAppWebpage) | ||||
|                           IconButton( | ||||
|                               onPressed: () { | ||||
|   | ||||
| @@ -678,6 +678,14 @@ class AppsProvider with ChangeNotifier { | ||||
|     return false; | ||||
|   } | ||||
|  | ||||
|   Future<void> openAppSettings(String appId) async { | ||||
|     final AndroidIntent intent = AndroidIntent( | ||||
|       action: 'action_application_details_settings', | ||||
|       data: 'package:$appId', | ||||
|     ); | ||||
|     await intent.launch(); | ||||
|   } | ||||
|  | ||||
|   Future<App?> checkUpdate(String appId) async { | ||||
|     App? currentApp = apps[appId]!.app; | ||||
|     SourceProvider sourceProvider = SourceProvider(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user