diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-03 22:21:34 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-03 22:21:34 +0530 |
| commit | 620f9ea0516d951e1d21793a5bb22e05a5c56949 (patch) | |
| tree | b9178704ffa1c60ce350b7ea0096220e1ad407d7 /lib/pages/Apps.dart | |
| parent | 008f625c89e0bb930dbb4b92c502e3a273b27807 (diff) | |
| download | daft-launcher-620f9ea0516d951e1d21793a5bb22e05a5c56949.tar.gz daft-launcher-620f9ea0516d951e1d21793a5bb22e05a5c56949.zip | |
Adds a simple add to favorites action storing to shard prefs
Diffstat (limited to 'lib/pages/Apps.dart')
| -rw-r--r-- | lib/pages/Apps.dart | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/pages/Apps.dart b/lib/pages/Apps.dart index 3b0845f..7049799 100644 --- a/lib/pages/Apps.dart +++ b/lib/pages/Apps.dart @@ -5,6 +5,8 @@ import 'package:android_intent/android_intent.dart'; import '../components/FixedContainer.dart'; import '../components/SearchableAppList.dart'; +import '../data/favorites.dart'; + class Option extends StatelessWidget { void Function() onTap; Widget child; @@ -44,18 +46,19 @@ class AppsView extends StatelessWidget { } Widget buildOptionsMenu(BuildContext ctx, Application app) { + ThemeData theme = Theme.of(ctx); + return Dialog( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12.0), - ), child: Container( decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.0), + color: theme.backgroundColor, ), - height: 300.0, - width: 300.0, + height: 170.0, child: ListView( children: [ + Option(child: Text('Add to favorites'), onTap: () async { + await addToFavorites(app); + }), Option(child: Text('App Settings'), onTap: () async { await AndroidIntent( action: 'action_application_details_settings', |
