From 8550d124017c04d8391990e8fd0818a8c6dbcef9 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 2 Jun 2020 19:28:14 +0530 Subject: Fixes default date and test case --- lib/pages/Home.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib') 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 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( stream: time$, - initialData: DateTime.now(), + initialData: defaultTime, builder: (BuildContext context, AsyncSnapshot snapshot) { switch (snapshot.connectionState) { case ConnectionState.active: -- cgit v1.3.1