mirror of
				https://github.com/ImranR98/Obtainium.git
				synced 2025-10-30 13:03:28 +01:00 
			
		
		
		
	Changes to bottom buttons UI on Apps page
This commit is contained in:
		| @@ -61,8 +61,6 @@ class AppsPageState extends State<AppsPage> { | ||||
|     var settingsProvider = context.watch<SettingsProvider>(); | ||||
|     var sourceProvider = SourceProvider(); | ||||
|     var listedApps = appsProvider.getAppValues().toList(); | ||||
|     var currentFilterIsUpdatesOnly = | ||||
|         filter.isIdenticalTo(updatesOnlyFilter, settingsProvider); | ||||
|  | ||||
|     refresh() { | ||||
|       HapticFeedback.lightImpact(); | ||||
| @@ -887,10 +885,17 @@ class AppsPageState extends State<AppsPage> { | ||||
|           }); | ||||
|     } | ||||
|  | ||||
|     getMainBottomButtonsRow() { | ||||
|       return Row( | ||||
|         mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||||
|         children: [ | ||||
|     getMainBottomButtons() { | ||||
|       return [ | ||||
|         IconButton( | ||||
|             visualDensity: VisualDensity.compact, | ||||
|             onPressed: getMassObtainFunction(), | ||||
|             tooltip: selectedAppIds.isEmpty | ||||
|                 ? tr('installUpdateApps') | ||||
|                 : tr('installUpdateSelectedApps'), | ||||
|             icon: const Icon( | ||||
|               Icons.file_download_outlined, | ||||
|             )), | ||||
|         IconButton( | ||||
|           visualDensity: VisualDensity.compact, | ||||
|           onPressed: selectedAppIds.isEmpty | ||||
| @@ -902,15 +907,6 @@ class AppsPageState extends State<AppsPage> { | ||||
|           tooltip: tr('removeSelectedApps'), | ||||
|           icon: const Icon(Icons.delete_outline_outlined), | ||||
|         ), | ||||
|           IconButton( | ||||
|               visualDensity: VisualDensity.compact, | ||||
|               onPressed: getMassObtainFunction(), | ||||
|               tooltip: selectedAppIds.isEmpty | ||||
|                   ? tr('installUpdateApps') | ||||
|                   : tr('installUpdateSelectedApps'), | ||||
|               icon: const Icon( | ||||
|                 Icons.file_download_outlined, | ||||
|               )), | ||||
|         IconButton( | ||||
|           visualDensity: VisualDensity.compact, | ||||
|           onPressed: selectedAppIds.isEmpty ? null : launchCategorizeDialog(), | ||||
| @@ -923,8 +919,7 @@ class AppsPageState extends State<AppsPage> { | ||||
|           tooltip: tr('more'), | ||||
|           icon: const Icon(Icons.more_horiz), | ||||
|         ), | ||||
|         ], | ||||
|       ); | ||||
|       ]; | ||||
|     } | ||||
|  | ||||
|     showFilterDialog() async { | ||||
| @@ -997,50 +992,33 @@ class AppsPageState extends State<AppsPage> { | ||||
|     } | ||||
|  | ||||
|     getFilterButtonsRow() { | ||||
|       var isFilterOff = filter.isIdenticalTo(neutralFilter, settingsProvider); | ||||
|       return Row( | ||||
|         children: [ | ||||
|           getSelectAllButton(), | ||||
|           const VerticalDivider(), | ||||
|           Expanded( | ||||
|               child: SingleChildScrollView( | ||||
|                   scrollDirection: Axis.horizontal, | ||||
|                   child: getMainBottomButtonsRow())), | ||||
|           const VerticalDivider(), | ||||
|           IconButton( | ||||
|             visualDensity: VisualDensity.compact, | ||||
|             onPressed: () { | ||||
|               color: Theme.of(context).colorScheme.primary, | ||||
|               style: const ButtonStyle(visualDensity: VisualDensity.compact), | ||||
|               tooltip: isFilterOff ? tr('filter') : tr('filterActive'), | ||||
|               onPressed: isFilterOff | ||||
|                   ? showFilterDialog | ||||
|                   : () { | ||||
|                       setState(() { | ||||
|                 if (currentFilterIsUpdatesOnly) { | ||||
|                         filter = AppsFilter(); | ||||
|                 } else { | ||||
|                   filter = updatesOnlyFilter; | ||||
|                 } | ||||
|                       }); | ||||
|                     }, | ||||
|             tooltip: currentFilterIsUpdatesOnly | ||||
|                 ? tr('removeOutdatedFilter') | ||||
|                 : tr('showOutdatedOnly'), | ||||
|             icon: Icon( | ||||
|               currentFilterIsUpdatesOnly | ||||
|                   ? Icons.update_disabled_rounded | ||||
|                   : Icons.update_rounded, | ||||
|               color: Theme.of(context).colorScheme.primary, | ||||
|               icon: Icon(isFilterOff | ||||
|                   ? Icons.filter_list_rounded | ||||
|                   : Icons.filter_list_off_rounded)), | ||||
|           const SizedBox( | ||||
|             width: 10, | ||||
|           ), | ||||
|           ), | ||||
|           TextButton.icon( | ||||
|               style: const ButtonStyle(visualDensity: VisualDensity.compact), | ||||
|               label: Text( | ||||
|                 filter.isIdenticalTo(neutralFilter, settingsProvider) | ||||
|                     ? tr('filter') | ||||
|                     : tr('filterActive'), | ||||
|                 style: TextStyle( | ||||
|                     fontWeight: | ||||
|                         filter.isIdenticalTo(neutralFilter, settingsProvider) | ||||
|                             ? FontWeight.normal | ||||
|                             : FontWeight.bold), | ||||
|               ), | ||||
|               onPressed: showFilterDialog, | ||||
|               icon: const Icon(Icons.filter_list_rounded)) | ||||
|           const VerticalDivider(), | ||||
|           Expanded( | ||||
|               child: Row( | ||||
|             mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||||
|             children: getMainBottomButtons(), | ||||
|           )), | ||||
|         ], | ||||
|       ); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user