diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-05 21:33:12 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-05 21:33:12 +0530 |
| commit | 83be047e15efd91a26ac27da1710b0e273706b19 (patch) | |
| tree | cfa6e1b5ad78261a4bdf6e579447c242e55873e4 /lib/pages/Home.dart | |
| parent | b66b37d3f6ccd1438077ecb67439365d080066ba (diff) | |
| download | daft-launcher-83be047e15efd91a26ac27da1710b0e273706b19.tar.gz daft-launcher-83be047e15efd91a26ac27da1710b0e273706b19.zip | |
Adds options menu with dummy refresh buttton
Diffstat (limited to 'lib/pages/Home.dart')
| -rw-r--r-- | lib/pages/Home.dart | 69 |
1 files changed, 55 insertions, 14 deletions
diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index b812288..1ce6d01 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:device_apps/device_apps.dart'; +import '../components/Option.dart'; import '../components/AppList.dart'; import '../components/FixedContainer.dart'; import '../data/config.dart'; @@ -15,6 +16,47 @@ class StatusInfoCard extends StatelessWidget { final timeFormat = DateFormat('h:mm a'); // H fr 24 hrs final dateFormat = DateFormat('EEEE, d MMM'); + Widget buildOptionsMenu(BuildContext ctx) { + var theme = Theme.of(ctx); + + return Dialog( + child: Container( + decoration: BoxDecoration( + color: theme.backgroundColor, + ), + height: 120.0, + child: ListView( + children: [ + Option( + icon: Icon( + Icons.brightness_4, + color: theme.primaryColor, + size: 16.0, + semanticLabel: 'Toggle dark mode', + ), + child: Text('Toggle dark mode'), + onTap: toggleTheme, + ), + Option( + icon: Icon( + Icons.refresh, + color: theme.primaryColor, + size: 16.0, + semanticLabel: 'Refresh', + ), + child: Text('Refresh'), + onTap: () {}, + ), + ], + ), + ), + ); + } + + void showOptions(BuildContext ctx) { + showDialog(context: ctx, builder: buildOptionsMenu); + } + @override Widget build(BuildContext ctx) { ThemeData theme = Theme.of(ctx); @@ -53,20 +95,19 @@ class StatusInfoCard extends StatelessWidget { Container( width: 40, height: 30, - child: Text(''), - //child: IconButton( - //padding: const EdgeInsets.all(0.0), - //visualDensity: const VisualDensity(vertical: 0.0, horizontal: 0.0), - //icon: Icon( - //Icons.brightness_4, - //color: theme.primaryColor, - //size: 16.0, - //semanticLabel: 'Toggle dark mode', - //), - //tooltip: 'Toggle dark mode', - //enableFeedback: true, - //onPressed: () { toggleTheme(); } - //), + child: IconButton( + padding: const EdgeInsets.all(0.0), + visualDensity: const VisualDensity(vertical: 0.0, horizontal: 0.0), + icon: Icon( + Icons.more_vert, + color: theme.primaryColor, + size: 20.0, + semanticLabel: 'Options', + ), + tooltip: 'Options', + enableFeedback: true, + onPressed: () => showOptions(ctx), + ), ), ], ), |
