aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-04 13:30:26 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-04 13:30:26 +0530
commit1d6fbb644e6c4f877cbcb1e1d02cb840086884dc (patch)
treea310b4f03bc551f5be2e5bba6de2ba41b550ca2c /lib
parenta9550c3a5088b8e25257480fb86ff5c9a2fed6d7 (diff)
downloaddaft-launcher-1d6fbb644e6c4f877cbcb1e1d02cb840086884dc.tar.gz
daft-launcher-1d6fbb644e6c4f877cbcb1e1d02cb840086884dc.zip
Adds icons in context menu
Diffstat (limited to '')
-rw-r--r--lib/components/AppContextMenu.dart50
1 files changed, 33 insertions, 17 deletions
diff --git a/lib/components/AppContextMenu.dart b/lib/components/AppContextMenu.dart
index ae42bd4..72d67aa 100644
--- a/lib/components/AppContextMenu.dart
+++ b/lib/components/AppContextMenu.dart
@@ -8,9 +8,10 @@ import '../data/favorites.dart';
class Option extends StatelessWidget {
void Function() onTap;
+ Widget icon;
Widget child;
- Option({ this.child, this.onTap }): super();
+ Option({ this.child, this.icon, this.onTap }): super();
@override
build(BuildContext ctx) {
@@ -18,7 +19,10 @@ class Option extends StatelessWidget {
children: [
ListTile(
contentPadding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0),
- title: child,
+ title: Row(children: [
+ Container(width: 36.0, padding: EdgeInsets.only(right: 16.0), child: icon),
+ child,
+ ]),
onTap: () {
onTap();
Navigator.pop(ctx);
@@ -48,21 +52,33 @@ class AppContextMenu extends StatelessWidget {
height: 170.0,
child: ListView(
children: [
- Option(child: Text(isFavorite ? 'Remove from favorites' : 'Add to favorites'), onTap: () async {
- await isFavorite ? removeFromFavorites(app) : addToFavorites(app);
- }),
- Option(child: Text('App Settings'), onTap: () async {
- await AndroidIntent(
- action: 'action_application_details_settings',
- data: 'package:${app.packageName}',
- ).launch();
- }),
- Option(child: Text('Uninstall'), onTap: () async {
- await AndroidIntent(
- action: 'android.intent.action.DELETE',
- data: 'package:${app.packageName}',
- ).launch();
- }),
+ Option(
+ icon: Icon(Icons.star, size: 22.0, color: theme.primaryColor),
+ child: Text(isFavorite ? 'Remove from favorites' : 'Add to favorites'),
+ onTap: () async {
+ await isFavorite ? removeFromFavorites(app) : addToFavorites(app);
+ },
+ ),
+ Option(
+ child: Text('App Settings'),
+ icon: Icon(Icons.settings, size: 22.0, color: theme.primaryColor),
+ onTap: () async {
+ await AndroidIntent(
+ action: 'action_application_details_settings',
+ data: 'package:${app.packageName}',
+ ).launch();
+ },
+ ),
+ Option(
+ child: Text('Uninstall'),
+ icon: Icon(Icons.delete_forever, size: 22.0, color: theme.primaryColor),
+ onTap: () async {
+ await AndroidIntent(
+ action: 'android.intent.action.DELETE',
+ data: 'package:${app.packageName}',
+ ).launch();
+ },
+ ),
],
),
),