drawer added, trying to fix text alignment

This commit is contained in:
Felix 2019-07-17 14:15:10 +01:00
parent 9e42671488
commit 157d485e3c
No known key found for this signature in database
GPG Key ID: 130EF6DC43E4DD07
4 changed files with 82 additions and 1 deletions

View File

@ -0,0 +1,71 @@
import 'package:flutter/material.dart';
import 'dart:io' show Platform;
class AwesomeDrawer {
Widget getDrawer(BuildContext context) {
return new Container(
width: 250,
color: Colors.white,
// padding: EdgeInsets.fromLTRB(32, 25, 32, 0),
child: ListView(
children: <Widget> [
Container(
padding: const EdgeInsets.fromLTRB(0, 15, 0, 0),
child :
FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/StatsPage"),
child:
Text("yeehaw",
textAlign: Platform.isIOS ? TextAlign.right : TextAlign.left,
style: new TextStyle(
fontSize: 32.0,
color: Colors.black,
),
),
),
),
Container(
padding: const EdgeInsets.fromLTRB(0, 15, 0, 0),
child :
FlatButton(onPressed: () => Navigator.of(context).pushReplacementNamed("/MorePage"), child:
Text("clickity clack",
textAlign: Platform.isIOS ? TextAlign.right : TextAlign.left,
style: new TextStyle(
fontSize: 32.0,
color: Colors.black,
),
),
),
),
Container(
padding: const EdgeInsets.fromLTRB(0, 15, 0, 0),
child :
FlatButton(onPressed: () => debugPrint("pressed"), child:
Text("scoot scoot",
style: new TextStyle(
fontSize: 32.0,
color: Colors.black,
),
),
),
),
Container(
padding: const EdgeInsets.fromLTRB(0, 15, 0, 0),
child :
FlatButton(onPressed: () => debugPrint("pressed"), child:
Text("reeeeeeeeee",
style: new TextStyle(
fontSize: 32.0,
color: Colors.black,
),
),
),
),
]
),
);
}
}

View File

@ -5,6 +5,7 @@ import 'package:local_spend/pages/receipt_page.dart';
import 'package:local_spend/pages/spash_screen.dart';
import 'package:local_spend/pages/more_page.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:local_spend/pages/stats_page.dart';
void main() {
runApp(MyApp());
@ -33,6 +34,7 @@ class MyApp extends StatelessWidget {
"/LoginPage": (BuildContext context) => LoginPage(),
"/ReceiptPage": (BuildContext context) => ReceiptPage(),
"/MorePage": (BuildContext context) => MorePage(),
"/StatsPage" : (BuildContext context) => StatsPage(),
},
home: SplashScreen(),
);

View File

@ -13,6 +13,7 @@ import 'package:datetime_picker_formfield/datetime_picker_formfield.dart';
import 'package:local_spend/common/apifunctions/find_organisations.dart';
import 'package:local_spend/common/widgets/popupListView.dart';
import 'package:local_spend/common/apifunctions/categories.dart';
import 'package:local_spend/common/widgets/awesome_drawer.dart';
const URL = "https://flutter.io/";
const demonstration = false;
@ -300,8 +301,10 @@ class ReceiptPageState extends State<ReceiptPage> {
@override
Widget build(BuildContext context) {
var drawer = new AwesomeDrawer();
return PlatformScaffold(
drawer: Drawer(),
drawer: drawer.getDrawer(context),
appBar: AppBar(
automaticallyImplyLeading: !Platform.isIOS, // done to remove UI glitch, now works on both platforms
// leading: Drawer(),

View File

@ -12,6 +12,7 @@ import 'package:local_spend/common/widgets/charts/grouped_bar_chart.dart';
import 'package:local_spend/common/widgets/charts/scatter_bucketingAxis_legend.dart';
import 'package:local_spend/common/widgets/charts/numeric_line_bar_combo.dart';
import 'package:local_spend/common/widgets/charts/series_legend_with_measures.dart';
import 'package:local_spend/common/widgets/awesome_drawer.dart';
const URL = "https://flutter.io/";
const demonstration = false;
@ -43,7 +44,11 @@ class StatsPageState extends State<StatsPage> {
@override
Widget build(BuildContext context) {
var drawer = new AwesomeDrawer();
return PlatformScaffold(
drawer: drawer.getDrawer(context),
appBar: AppBar(
backgroundColor: Colors.blue[400],
title: Text(