diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-02 19:28:14 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-02 19:28:14 +0530 |
| commit | 8550d124017c04d8391990e8fd0818a8c6dbcef9 (patch) | |
| tree | 7ab5300e95e7da4bd89918eb13fa03fc28039c3e /lib | |
| parent | 1a148e4edf3a27afbc0944429c1ebb6e2599b832 (diff) | |
| download | daft-launcher-8550d124017c04d8391990e8fd0818a8c6dbcef9.tar.gz daft-launcher-8550d124017c04d8391990e8fd0818a8c6dbcef9.zip | |
Fixes default date and test case
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pages/Home.dart | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index 1f553e3..f2809db 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -4,11 +4,12 @@ import 'package:intl/intl.dart'; class HomeView extends StatelessWidget { Stream<DateTime> time$; + DateTime defaultTime; - final timeFormat = new DateFormat.jm(); - final dateFormat = DateFormat('d, MMM'); + final timeFormat = new DateFormat.jm(); // hm fr 24 hrs + final dateFormat = DateFormat('d MMMM'); - HomeView({ this.time$ }): super(); + HomeView({ this.time$, this.defaultTime }): super(); @override Widget build(BuildContext ctx) { @@ -18,7 +19,7 @@ class HomeView extends StatelessWidget { children: [ StreamBuilder<DateTime>( stream: time$, - initialData: DateTime.now(), + initialData: defaultTime, builder: (BuildContext context, AsyncSnapshot<DateTime> snapshot) { switch (snapshot.connectionState) { case ConnectionState.active: |
