aboutsummaryrefslogtreecommitdiff
path: root/lib/pages
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-06-03 19:45:38 +0530
committerAkshay Nair <phenax5@gmail.com>2020-06-03 19:45:38 +0530
commit008f625c89e0bb930dbb4b92c502e3a273b27807 (patch)
tree26015d454303fd5db838dac5b4f63366f607ae03 /lib/pages
parent871706b606c77eeac13bfcea67c3ce1d71203d2c (diff)
downloaddaft-launcher-008f625c89e0bb930dbb4b92c502e3a273b27807.tar.gz
daft-launcher-008f625c89e0bb930dbb4b92c502e3a273b27807.zip
Fixes type issue and adds style to the dark mode button
Diffstat (limited to '')
-rw-r--r--lib/pages/Home.dart69
1 files changed, 45 insertions, 24 deletions
diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart
index 8efa86e..b9663fd 100644
--- a/lib/pages/Home.dart
+++ b/lib/pages/Home.dart
@@ -16,6 +16,8 @@ class StatusInfoCard extends StatelessWidget {
@override
Widget build(BuildContext ctx) {
+ ThemeData theme = Theme.of(ctx);
+
return StreamBuilder<DateTime>(
stream: time$,
initialData: defaultTime,
@@ -23,36 +25,55 @@ class StatusInfoCard extends StatelessWidget {
Widget child = Text('Loading...', key: Key('loading'));
if (snapshot.hasData) {
- child = Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(timeFormat.format(snapshot.data),
- key: Key('time'),
- textAlign: TextAlign.left,
- style: const TextStyle(
- fontSize: 32.0,
- fontWeight: FontWeight.bold,
+ child = Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Expanded(child: Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(timeFormat.format(snapshot.data),
+ key: Key('time'),
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontSize: 32.0,
+ fontWeight: FontWeight.bold,
+ ),
),
- ),
- Text(dateFormat.format(snapshot.data),
- key: Key('date'),
- textAlign: TextAlign.left,
- style: const TextStyle(
- fontSize: 16.0,
- fontWeight: FontWeight.w300,
+ Text(dateFormat.format(snapshot.data),
+ key: Key('date'),
+ textAlign: TextAlign.left,
+ style: const TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.w300,
+ ),
),
- ),
- FlatButton(
- child: Text('Theme'),
- onPressed: () { toggleTheme(); }
- ),
- ]
+ ]
+ )),
+ Container(
+ width: 40,
+ height: 30,
+ 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(); }
+ ),
+ ),
+ ],
);
}
return Container(
- height: 300,
+ height: 100,
padding: EdgeInsets.symmetric(vertical: 8.0),
child: Align(alignment: Alignment.topLeft, child: child),
);