diff options
| author | Akshay Nair <phenax5@gmail.com> | 2020-06-02 21:11:43 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2020-06-02 21:11:43 +0530 |
| commit | 757e907a21921ddedb8e39f567449f2e32fd2751 (patch) | |
| tree | 7678abf069f5bf549d80ee92bb490530fef53bff | |
| parent | 20f1fa5d50b60576594d0ebb434b2ae237ff2cac (diff) | |
| download | daft-launcher-757e907a21921ddedb8e39f567449f2e32fd2751.tar.gz daft-launcher-757e907a21921ddedb8e39f567449f2e32fd2751.zip | |
Some styling for the time widget
| -rw-r--r-- | lib/pages/Home.dart | 28 | ||||
| -rw-r--r-- | test/homeview_test.dart | 5 |
2 files changed, 25 insertions, 8 deletions
diff --git a/lib/pages/Home.dart b/lib/pages/Home.dart index d4c8d19..8913fdb 100644 --- a/lib/pages/Home.dart +++ b/lib/pages/Home.dart @@ -20,15 +20,33 @@ class StatusInfoCard extends StatelessWidget { Widget child = Text('Loading...', key: Key('loading')); if (snapshot.hasData) { - child = Column(children: [ - Text(timeFormat.format(snapshot.data), key: Key('time')), - Text(dateFormat.format(snapshot.data), key: Key('date')), - ]); + 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: 20.0, + ), + ), + ] + ); } return Container( height: 300, - child: child, + padding: EdgeInsets.symmetric(vertical: 8.0), + child: Align(alignment: Alignment.topLeft, child: child), ); }, ); diff --git a/test/homeview_test.dart b/test/homeview_test.dart index e291cca..d967ddf 100644 --- a/test/homeview_test.dart +++ b/test/homeview_test.dart @@ -37,12 +37,11 @@ void main() { await tester.pumpWidget(wrapper(HomeView(time$))); await tester.pump(); + await tester.pump(Duration(seconds: 2)); + var timeWidget = find.byKey(Key('time')); var dateWidget = find.byKey(Key('date')); - await waitFor(Duration(milliseconds: 50)); - await tester.pump(); - expect(timeWidget, findsOneWidget); //for(var w in timeWidget.evaluate()) { //expect(w.widget.toString(), contains('10:25 AM')); |
