From 248d5f698331025a7327a3793e57c55963d788aa Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 17 Jul 2019 16:45:37 +0100 Subject: [PATCH] names appropriated, pages updated --- lib/common/widgets/awesome_drawer.dart | 12 ++++++------ lib/pages/more_page.dart | 20 +++++++------------- lib/pages/stats_page.dart | 26 -------------------------- 3 files changed, 13 insertions(+), 45 deletions(-) diff --git a/lib/common/widgets/awesome_drawer.dart b/lib/common/widgets/awesome_drawer.dart index a3bf610..4cbe7ca 100644 --- a/lib/common/widgets/awesome_drawer.dart +++ b/lib/common/widgets/awesome_drawer.dart @@ -14,9 +14,9 @@ class AwesomeDrawer { Container( padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), child : - FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/StatsPage"), + FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/ReceiptPage"), child: - Text("yeehaw", + Text("Submit Receipt", textAlign: Platform.isIOS ? TextAlign.right : TextAlign.left, style: new TextStyle( fontSize: 32.0, @@ -29,8 +29,8 @@ class AwesomeDrawer { Container( padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), child : - FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/MorePage"), child: - Text("clickity clack", + FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/StatsPage"), child: + Text("Statistics", textAlign: Platform.isIOS ? TextAlign.right : TextAlign.left, style: new TextStyle( fontSize: 32.0, @@ -42,8 +42,8 @@ class AwesomeDrawer { Container( padding: const EdgeInsets.fromLTRB(0, 15, 0, 0), child : - FlatButton(onPressed: () => debugPrint("pressed"), child: - Text("scoot scoot", + FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/MorePage"), child: + Text("More", style: new TextStyle( fontSize: 32.0, color: Colors.black, diff --git a/lib/pages/more_page.dart b/lib/pages/more_page.dart index 21814de..b4cc6b1 100644 --- a/lib/pages/more_page.dart +++ b/lib/pages/more_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:local_spend/common/platform/platform_scaffold.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -6,6 +5,7 @@ import 'package:local_spend/common/functions/logout.dart'; import 'package:url_launcher/url_launcher.dart'; import 'package:local_spend/common/functions/customAbout.dart' as custom; import 'package:local_spend/common/functions/showDialogTwoButtons.dart'; +import 'package:local_spend/common/widgets/awesome_drawer.dart'; const URL = "https://flutter.io/"; const demonstration = false; @@ -44,18 +44,13 @@ class MorePageState extends State { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () { - if (Navigator.canPop(context)) { - Navigator.of(context).pushNamedAndRemoveUntil( - '/LoginPage', (Route route) => false); - } else { - Navigator.of(context).pushReplacementNamed('/LoginPage'); - } - }, - child: PlatformScaffold( + var drawer = new AwesomeDrawer(); + + return new PlatformScaffold( + drawer: drawer.getDrawer(context), appBar: AppBar( + backgroundColor: Colors.blue[400], title: Text( "More", @@ -173,7 +168,6 @@ class MorePageState extends State { ], ), ), - ), - ); + ); } } diff --git a/lib/pages/stats_page.dart b/lib/pages/stats_page.dart index 68a7171..6ae8207 100644 --- a/lib/pages/stats_page.dart +++ b/lib/pages/stats_page.dart @@ -58,7 +58,6 @@ class StatsPageState extends State { color: Colors.white, ), ), -// leading: BackButton(), centerTitle: true, iconTheme: IconThemeData(color: Colors.black), ), @@ -68,25 +67,6 @@ class StatsPageState extends State { padding: EdgeInsets.fromLTRB(0, 0, 0, 0), child: ListView( children: [ - // some graphs and charts here etc -// Container( -// padding: EdgeInsets.fromLTRB(0.0,17,0.0,0.0), -// child : Text( -// "Really Cool Chart", -// textAlign: TextAlign.center, -// style: TextStyle( -// fontSize: 22.0, -// color: Colors.black, -// fontWeight: FontWeight.bold, -// ), -// ), -// ), -// -// Container( -// height: 250, -//// width: 250, -// child: new DonutPieChart.withSampleData() -// ), Container( padding: EdgeInsets.fromLTRB(0.0,17,0.0,0.0), @@ -104,7 +84,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new GroupedBarChart.withSampleData() ), @@ -124,7 +103,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new BucketingAxisScatterPlotChart.withSampleData() ), @@ -164,7 +142,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new DonutAutoLabelChart.withSampleData() ), @@ -184,7 +161,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new DonutPieChart.withSampleData() ), @@ -204,7 +180,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new NumericComboLineBarChart.withSampleData() ), @@ -224,7 +199,6 @@ class StatsPageState extends State { Container( padding: EdgeInsets.symmetric(horizontal: 10), height: 200, -// width: 250, child: new LegendWithMeasures.withSampleData() ),