Compare commits

...
This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.

3 Commits

Author SHA1 Message Date
Felix 248d5f6983
names appropriated, pages updated 2019-07-17 16:45:37 +01:00
Felix 157d485e3c
drawer added, trying to fix text alignment 2019-07-17 14:15:10 +01:00
Felix 9e42671488
side bar added, ran into weird problem 2019-07-17 12:54:31 +01:00
9 changed files with 117 additions and 66 deletions

View File

@ -6,13 +6,13 @@ PODS:
- Flutter
DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios-profile`)
- Flutter (from `.symlinks/flutter/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios-profile"
:path: ".symlinks/flutter/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
url_launcher:

View File

@ -281,7 +281,7 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework",
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (

View File

@ -31,7 +31,7 @@ Future<LoginModel> requestLoginAPI(
var user = new LoginModel.fromJson(responseJson);
saveCurrentLogin(responseJson, body["email"]);
Navigator.of(context).pushReplacementNamed('/HomePage');
Navigator.of(context).pushReplacementNamed('/ReceiptPage');
return LoginModel.fromJson(responseJson);
} else {

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("/ReceiptPage"),
child:
Text("Submit Receipt",
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("/StatsPage"), child:
Text("Statistics",
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("More",
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

@ -92,9 +92,9 @@ class LoginPageState extends State<LoginPage> {
onWillPop: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pushNamedAndRemoveUntil(
'/HomePage', (Route<dynamic> route) => false);
'/ReceiptPage', (Route<dynamic> route) => false);
} else {
Navigator.of(context).pushReplacementNamed('/HomePage');
Navigator.of(context).pushReplacementNamed('/ReceiptPage');
}
},
child: PlatformScaffold(

View File

@ -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<MorePage> {
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () {
if (Navigator.canPop(context)) {
Navigator.of(context).pushNamedAndRemoveUntil(
'/LoginPage', (Route<dynamic> 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<MorePage> {
],
),
),
),
);
);
}
}

View File

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io' show Platform;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -12,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;
@ -143,7 +145,7 @@ class ReceiptPageState extends State<ReceiptPage> {
child: new Text("OK"),
onPressed: () {
Navigator.of(context).pop();
Navigator.of(context).pushReplacementNamed("/HomePage");
Navigator.of(context).pushReplacementNamed("/ReceiptPage");
},
),
],
@ -169,7 +171,7 @@ class ReceiptPageState extends State<ReceiptPage> {
receipt.essential = essential;
submitReceiptAPI(context, receipt);
Navigator.of(context).pushReplacementNamed("/HomePage");
Navigator.of(context).pushReplacementNamed("/ReceiptPage");
}
}
}
@ -299,9 +301,13 @@ class ReceiptPageState extends State<ReceiptPage> {
@override
Widget build(BuildContext context) {
var drawer = new AwesomeDrawer();
return PlatformScaffold(
drawer: drawer.getDrawer(context),
appBar: AppBar(
automaticallyImplyLeading: !Platform.isIOS, // done to remove UI glitch, now works on both platforms
// leading: Drawer(),
backgroundColor: Colors.blue[400],
title: Text(
"Submit Receipt",
@ -310,9 +316,8 @@ class ReceiptPageState extends State<ReceiptPage> {
color: Colors.white,
),
),
// leading: BackButton(),
centerTitle: true,
iconTheme: IconThemeData(color: Colors.black),
// iconTheme: IconThemeData(color: Colors.black),
),
body: Container(
@ -542,23 +547,23 @@ class ReceiptPageState extends State<ReceiptPage> {
),
),
Container(
padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
child: DropdownButton<String>(
value: _categoryController.text,
onChanged: (String newValue) {
setState(() {
_categoryController.text = newValue;
});
},
items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
)
),
// Container(
// padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
// child: DropdownButton<String>(
// value: _categoryController.text,
// onChanged: (String newValue) {
// setState(() {
// _categoryController.text = newValue;
// });
// },
// items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
// return DropdownMenuItem<String>(
// value: value,
// child: Text(value),
// );
// }).toList(),
// )
// ),
],
),
),

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(
@ -53,7 +58,6 @@ class StatsPageState extends State<StatsPage> {
color: Colors.white,
),
),
// leading: BackButton(),
centerTitle: true,
iconTheme: IconThemeData(color: Colors.black),
),
@ -63,25 +67,6 @@ class StatsPageState extends State<StatsPage> {
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: ListView(
children: <Widget>[
// 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),
@ -99,7 +84,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new GroupedBarChart.withSampleData()
),
@ -119,7 +103,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new BucketingAxisScatterPlotChart.withSampleData()
),
@ -159,7 +142,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new DonutAutoLabelChart.withSampleData()
),
@ -179,7 +161,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new DonutPieChart.withSampleData()
),
@ -199,7 +180,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new NumericComboLineBarChart.withSampleData()
),
@ -219,7 +199,6 @@ class StatsPageState extends State<StatsPage> {
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
height: 200,
// width: 250,
child: new LegendWithMeasures.withSampleData()
),