diff --git a/lib/home.dart b/lib/home.dart index 47c7a2e..25f4d35 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -25,6 +25,7 @@ class _HomeScreenState extends State { @override Widget build(BuildContext context) { return Scaffold( + backgroundColor: Colors.white, body: PageView( controller: _pageController, children: const [ diff --git a/lib/main.dart b/lib/main.dart index 065a02c..6a0194c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:leg_barkr_app/home.dart'; +import 'package:flutter/services.dart'; void main() { + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.black12)); runApp(const Main()); } diff --git a/lib/view/steps/steps_chart.dart b/lib/view/steps/steps_chart.dart index e911a8a..ecb35e1 100644 --- a/lib/view/steps/steps_chart.dart +++ b/lib/view/steps/steps_chart.dart @@ -3,7 +3,7 @@ import 'package:charts_flutter/flutter.dart' as charts; import 'package:leg_barkr_app/model/steps_series.dart'; class StepsChart extends StatelessWidget { - final List data; + List data; StepsChart(this.data); @@ -19,7 +19,11 @@ class StepsChart extends StatelessWidget { ) ]; - return new charts.BarChart(series, animate: true,); + return Container( + height: 600, + width: double.infinity, + child: charts.BarChart(series, animate: true) + ); } } \ No newline at end of file diff --git a/lib/view/steps/steps_page.dart b/lib/view/steps/steps_page.dart index 1c3981b..2c2c3c9 100644 --- a/lib/view/steps/steps_page.dart +++ b/lib/view/steps/steps_page.dart @@ -2,6 +2,7 @@ import 'package:charts_flutter/flutter.dart' as charts; import 'package:flutter/material.dart'; import 'package:leg_barkr_app/model/steps_series.dart'; import 'package:leg_barkr_app/view/steps/steps_chart.dart'; +import 'package:leg_barkr_app/view/steps/steps_today.dart'; class StepsPage extends StatefulWidget { const StepsPage({ Key? key }) : super(key: key); @@ -25,12 +26,15 @@ class _StepsPageState extends State { @override Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - body: Center( - child: StepsChart(data) - ), - ), + return Padding( + padding: EdgeInsets.fromLTRB(0.0, 50.0, 10.0, 0.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + StepsToday(5123), + new Expanded(child: StepsChart(data)) + ], + ) ); } } \ No newline at end of file diff --git a/lib/view/steps/steps_today.dart b/lib/view/steps/steps_today.dart new file mode 100644 index 0000000..e00150c --- /dev/null +++ b/lib/view/steps/steps_today.dart @@ -0,0 +1,22 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class StepsToday extends StatelessWidget { + int count; + + StepsToday(this.count); + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Text("Steps today", style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 20), textAlign: TextAlign.center), + Text(count.toString(), style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold, fontSize: 40), textAlign: TextAlign.center) + ], + ) + ); + } + +} \ No newline at end of file