diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-02 23:15:57 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-02 23:15:57 +0530 |
| commit | 3ad62745af3a23170635ace1c7e29e0df7a8ac13 (patch) | |
| tree | 0a3f07536c8dc8dc54a85bd8a78cb41816627fbd /lib/pages/Apps.dart | |
| parent | 0b7f017d77e4d042c997f51f49c85a9a7a723e40 (diff) | |
| download | daft-launcher-3ad62745af3a23170635ace1c7e29e0df7a8ac13.tar.gz daft-launcher-3ad62745af3a23170635ace1c7e29e0df7a8ac13.zip | |
Creates dialog menu with dummy optios
Diffstat (limited to 'lib/pages/Apps.dart')
| -rw-r--r-- | lib/pages/Apps.dart | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/lib/pages/Apps.dart b/lib/pages/Apps.dart index 7252aae..d267f10 100644 --- a/lib/pages/Apps.dart +++ b/lib/pages/Apps.dart @@ -4,6 +4,30 @@ import 'package:device_apps/device_apps.dart'; import '../components/FixedContainer.dart'; import '../components/SearchableAppList.dart'; +class Option extends StatelessWidget { + void Function() onTap; + Widget child; + + Option({ this.child, this.onTap }): super(); + + @override + build(BuildContext ctx) { + return Column( + children: [ + ListTile( + contentPadding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 16.0), + title: child, + onTap: () { + onTap(); + Navigator.pop(ctx); + }, + ), + Divider(height: 1.0), + ], + ); + } +} + class AppsView extends StatelessWidget { Future<List<Application>> appListF = DeviceApps.getInstalledApplications( includeSystemApps: false, @@ -14,8 +38,29 @@ class AppsView extends StatelessWidget { DeviceApps.openApp(app.packageName); } - void openOptionsMenu(Application app) { - debugPrint('Wow'); + void openOptionsMenu(BuildContext ctx, Application app) { + showDialog(context: ctx, builder: (BuildContext ctx) => buildOptionsMenu(ctx, app)); + } + + Widget buildOptionsMenu(BuildContext ctx, Application app) { + return Dialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12.0), + ), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.0), + ), + height: 300.0, + width: 300.0, + child: ListView( + children: [ + Option(child: Text('Cool'), onTap: () { debugPrint('Cool'); }), + Option(child: Text('Wow'), onTap: () { debugPrint('Wow'); }), + ], + ), + ), + ); } @override @@ -25,7 +70,7 @@ class AppsView extends StatelessWidget { child: SearchableAppList( appListF: appListF, openApp: openApp, - openOptionsMenu: openOptionsMenu, + openOptionsMenu: (app) => openOptionsMenu(ctx, app), ), ); } |
