Option to move non-installed apps to bottom (#264)

This commit is contained in:
Imran Remtulla
2023-05-05 23:08:34 -04:00
parent fb9e66332d
commit 30c89fe385
12 changed files with 54 additions and 6 deletions

View File

@@ -185,6 +185,18 @@ class AppsPageState extends State<AppsPage> {
listedApps = [...temp, ...listedApps];
}
if (settingsProvider.buryNonInstalled) {
var temp = [];
listedApps = listedApps.where((sa) {
if (sa.app.installedVersion == null) {
temp.add(sa);
return false;
}
return true;
}).toList();
listedApps = [...listedApps, ...temp];
}
var tempPinned = [];
var tempNotPinned = [];
for (var a in listedApps) {

View File

@@ -227,7 +227,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('useBlackTheme')),
Flexible(child: Text(tr('useBlackTheme'))),
Switch(
value: settingsProvider.useBlackTheme,
onChanged: (value) {
@@ -254,7 +254,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('showWebInAppView')),
Flexible(child: Text(tr('showWebInAppView'))),
Switch(
value: settingsProvider.showAppWebpage,
onChanged: (value) {
@@ -266,7 +266,7 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('pinUpdates')),
Flexible(child: Text(tr('pinUpdates'))),
Switch(
value: settingsProvider.pinUpdates,
onChanged: (value) {
@@ -278,7 +278,21 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('groupByCategory')),
Flexible(
child: Text(
tr('moveNonInstalledAppsToBottom'))),
Switch(
value: settingsProvider.buryNonInstalled,
onChanged: (value) {
settingsProvider.buryNonInstalled = value;
})
],
),
height16,
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(child: Text(tr('groupByCategory'))),
Switch(
value: settingsProvider.groupByCategory,
onChanged: (value) {
@@ -290,7 +304,9 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('dontShowTrackOnlyWarnings')),
Flexible(
child:
Text(tr('dontShowTrackOnlyWarnings'))),
Switch(
value:
settingsProvider.hideTrackOnlyWarning,
@@ -304,7 +320,9 @@ class _SettingsPageState extends State<SettingsPage> {
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(tr('dontShowAPKOriginWarnings')),
Flexible(
child:
Text(tr('dontShowAPKOriginWarnings'))),
Switch(
value:
settingsProvider.hideAPKOriginWarning,

View File

@@ -154,6 +154,15 @@ class SettingsProvider with ChangeNotifier {
notifyListeners();
}
bool get buryNonInstalled {
return prefs?.getBool('buryNonInstalled') ?? false;
}
set buryNonInstalled(bool show) {
prefs?.setBool('buryNonInstalled', show);
notifyListeners();
}
bool get groupByCategory {
return prefs?.getBool('groupByCategory') ?? false;
}