cleanup
This commit is contained in:
parent
9704433b4c
commit
2906453316
4 changed files with 14 additions and 14 deletions
|
|
@ -263,11 +263,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
setState(() {
|
||||
app.isPinned = !app.isPinned;
|
||||
if (app.isPinned) {
|
||||
app.isDemoted = false; // Cannot be pinned and demoted at the same time
|
||||
app.isDemoted = false;
|
||||
}
|
||||
});
|
||||
await SharedPreferencesService().setBool("isPinned_${app.packageName}", app.isPinned);
|
||||
if (app.isPinned) { // pinning clears demote
|
||||
if (app.isPinned) {
|
||||
await SharedPreferencesService().setBool("isDemoted_${app.packageName}", false);
|
||||
}
|
||||
_filterApps();
|
||||
|
|
@ -277,11 +277,11 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
setState(() {
|
||||
app.isDemoted = !app.isDemoted;
|
||||
if (app.isDemoted) {
|
||||
app.isPinned = false; // Cannot be pinned and demoted at the same time
|
||||
app.isPinned = false;
|
||||
}
|
||||
});
|
||||
await SharedPreferencesService().setBool("isDemoted_${app.packageName}", app.isDemoted);
|
||||
if (app.isDemoted) { // demoting clears pin
|
||||
if (app.isDemoted) {
|
||||
await SharedPreferencesService().setBool("isPinned_${app.packageName}", false);
|
||||
}
|
||||
_filterApps();
|
||||
|
|
@ -300,6 +300,10 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text('Cancel'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
setState(() {
|
||||
|
|
@ -314,10 +318,6 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
},
|
||||
child: Text('Save'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text('Cancel'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
@ -415,7 +415,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
hintText: 'Search apps...',
|
||||
border: InputBorder.none,
|
||||
),
|
||||
style: TextStyle(color: Colors.white),
|
||||
style: TextStyle(color: Theme.of(context).colorScheme.onSurface),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
|
|
@ -595,7 +595,7 @@ class _AppLauncherScreenState extends State<AppLauncherScreen> with WidgetsBindi
|
|||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
: null,
|
||||
trailing: _buildTrailingIcon(app), // Add trailing icon
|
||||
trailing: _buildTrailingIcon(app),
|
||||
onTap: () => _launchApp(app),
|
||||
onLongPress: () => _showContextMenu(context, app),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue