Compare commits
3 commits
developmen
...
testingSid
Author | SHA1 | Date | |
---|---|---|---|
|
248d5f6983 | ||
|
157d485e3c | ||
|
9e42671488 |
9 changed files with 117 additions and 66 deletions
|
@ -6,13 +6,13 @@ PODS:
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
- Flutter (from `.symlinks/flutter/ios-profile`)
|
- Flutter (from `.symlinks/flutter/ios`)
|
||||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: ".symlinks/flutter/ios-profile"
|
:path: ".symlinks/flutter/ios"
|
||||||
shared_preferences:
|
shared_preferences:
|
||||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||||
url_launcher:
|
url_launcher:
|
||||||
|
|
|
@ -281,7 +281,7 @@
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
"${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";
|
name = "[CP] Embed Pods Frameworks";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
|
|
|
@ -31,7 +31,7 @@ Future<LoginModel> requestLoginAPI(
|
||||||
var user = new LoginModel.fromJson(responseJson);
|
var user = new LoginModel.fromJson(responseJson);
|
||||||
|
|
||||||
saveCurrentLogin(responseJson, body["email"]);
|
saveCurrentLogin(responseJson, body["email"]);
|
||||||
Navigator.of(context).pushReplacementNamed('/HomePage');
|
Navigator.of(context).pushReplacementNamed('/ReceiptPage');
|
||||||
|
|
||||||
return LoginModel.fromJson(responseJson);
|
return LoginModel.fromJson(responseJson);
|
||||||
} else {
|
} else {
|
||||||
|
|
71
lib/common/widgets/awesome_drawer.dart
Normal file
71
lib/common/widgets/awesome_drawer.dart
Normal 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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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/spash_screen.dart';
|
||||||
import 'package:local_spend/pages/more_page.dart';
|
import 'package:local_spend/pages/more_page.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
import 'package:local_spend/pages/stats_page.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(MyApp());
|
runApp(MyApp());
|
||||||
|
@ -33,6 +34,7 @@ class MyApp extends StatelessWidget {
|
||||||
"/LoginPage": (BuildContext context) => LoginPage(),
|
"/LoginPage": (BuildContext context) => LoginPage(),
|
||||||
"/ReceiptPage": (BuildContext context) => ReceiptPage(),
|
"/ReceiptPage": (BuildContext context) => ReceiptPage(),
|
||||||
"/MorePage": (BuildContext context) => MorePage(),
|
"/MorePage": (BuildContext context) => MorePage(),
|
||||||
|
"/StatsPage" : (BuildContext context) => StatsPage(),
|
||||||
},
|
},
|
||||||
home: SplashScreen(),
|
home: SplashScreen(),
|
||||||
);
|
);
|
||||||
|
|
|
@ -92,9 +92,9 @@ class LoginPageState extends State<LoginPage> {
|
||||||
onWillPop: () {
|
onWillPop: () {
|
||||||
if (Navigator.canPop(context)) {
|
if (Navigator.canPop(context)) {
|
||||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||||
'/HomePage', (Route<dynamic> route) => false);
|
'/ReceiptPage', (Route<dynamic> route) => false);
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pushReplacementNamed('/HomePage');
|
Navigator.of(context).pushReplacementNamed('/ReceiptPage');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: PlatformScaffold(
|
child: PlatformScaffold(
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:local_spend/common/platform/platform_scaffold.dart';
|
import 'package:local_spend/common/platform/platform_scaffold.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.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:url_launcher/url_launcher.dart';
|
||||||
import 'package:local_spend/common/functions/customAbout.dart' as custom;
|
import 'package:local_spend/common/functions/customAbout.dart' as custom;
|
||||||
import 'package:local_spend/common/functions/showDialogTwoButtons.dart';
|
import 'package:local_spend/common/functions/showDialogTwoButtons.dart';
|
||||||
|
import 'package:local_spend/common/widgets/awesome_drawer.dart';
|
||||||
|
|
||||||
const URL = "https://flutter.io/";
|
const URL = "https://flutter.io/";
|
||||||
const demonstration = false;
|
const demonstration = false;
|
||||||
|
@ -44,18 +44,13 @@ class MorePageState extends State<MorePage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return WillPopScope(
|
var drawer = new AwesomeDrawer();
|
||||||
onWillPop: () {
|
|
||||||
if (Navigator.canPop(context)) {
|
return new PlatformScaffold(
|
||||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
drawer: drawer.getDrawer(context),
|
||||||
'/LoginPage', (Route<dynamic> route) => false);
|
|
||||||
} else {
|
|
||||||
Navigator.of(context).pushReplacementNamed('/LoginPage');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: PlatformScaffold(
|
|
||||||
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
|
||||||
backgroundColor: Colors.blue[400],
|
backgroundColor: Colors.blue[400],
|
||||||
title: Text(
|
title: Text(
|
||||||
"More",
|
"More",
|
||||||
|
@ -173,7 +168,6 @@ class MorePageState extends State<MorePage> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
import 'dart:io' show Platform;
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.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/apifunctions/find_organisations.dart';
|
||||||
import 'package:local_spend/common/widgets/popupListView.dart';
|
import 'package:local_spend/common/widgets/popupListView.dart';
|
||||||
import 'package:local_spend/common/apifunctions/categories.dart';
|
import 'package:local_spend/common/apifunctions/categories.dart';
|
||||||
|
import 'package:local_spend/common/widgets/awesome_drawer.dart';
|
||||||
|
|
||||||
const URL = "https://flutter.io/";
|
const URL = "https://flutter.io/";
|
||||||
const demonstration = false;
|
const demonstration = false;
|
||||||
|
@ -143,7 +145,7 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
child: new Text("OK"),
|
child: new Text("OK"),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
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;
|
receipt.essential = essential;
|
||||||
|
|
||||||
submitReceiptAPI(context, receipt);
|
submitReceiptAPI(context, receipt);
|
||||||
Navigator.of(context).pushReplacementNamed("/HomePage");
|
Navigator.of(context).pushReplacementNamed("/ReceiptPage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,9 +301,13 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var drawer = new AwesomeDrawer();
|
||||||
return PlatformScaffold(
|
return PlatformScaffold(
|
||||||
|
drawer: drawer.getDrawer(context),
|
||||||
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: !Platform.isIOS, // done to remove UI glitch, now works on both platforms
|
||||||
|
// leading: Drawer(),
|
||||||
backgroundColor: Colors.blue[400],
|
backgroundColor: Colors.blue[400],
|
||||||
title: Text(
|
title: Text(
|
||||||
"Submit Receipt",
|
"Submit Receipt",
|
||||||
|
@ -310,9 +316,8 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// leading: BackButton(),
|
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
iconTheme: IconThemeData(color: Colors.black),
|
// iconTheme: IconThemeData(color: Colors.black),
|
||||||
),
|
),
|
||||||
|
|
||||||
body: Container(
|
body: Container(
|
||||||
|
@ -542,23 +547,23 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Container(
|
// Container(
|
||||||
padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
|
// padding: const EdgeInsets.fromLTRB(29, 0, 0, 0),
|
||||||
child: DropdownButton<String>(
|
// child: DropdownButton<String>(
|
||||||
value: _categoryController.text,
|
// value: _categoryController.text,
|
||||||
onChanged: (String newValue) {
|
// onChanged: (String newValue) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
_categoryController.text = newValue;
|
// _categoryController.text = newValue;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
|
// items: _categoryDropDownItems.map<DropdownMenuItem<String>>((String value) {
|
||||||
return DropdownMenuItem<String>(
|
// return DropdownMenuItem<String>(
|
||||||
value: value,
|
// value: value,
|
||||||
child: Text(value),
|
// child: Text(value),
|
||||||
);
|
// );
|
||||||
}).toList(),
|
// }).toList(),
|
||||||
)
|
// )
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -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/scatter_bucketingAxis_legend.dart';
|
||||||
import 'package:local_spend/common/widgets/charts/numeric_line_bar_combo.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/charts/series_legend_with_measures.dart';
|
||||||
|
import 'package:local_spend/common/widgets/awesome_drawer.dart';
|
||||||
|
|
||||||
const URL = "https://flutter.io/";
|
const URL = "https://flutter.io/";
|
||||||
const demonstration = false;
|
const demonstration = false;
|
||||||
|
@ -43,7 +44,11 @@ class StatsPageState extends State<StatsPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
var drawer = new AwesomeDrawer();
|
||||||
|
|
||||||
return PlatformScaffold(
|
return PlatformScaffold(
|
||||||
|
drawer: drawer.getDrawer(context),
|
||||||
|
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
backgroundColor: Colors.blue[400],
|
backgroundColor: Colors.blue[400],
|
||||||
title: Text(
|
title: Text(
|
||||||
|
@ -53,7 +58,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// leading: BackButton(),
|
|
||||||
centerTitle: true,
|
centerTitle: true,
|
||||||
iconTheme: IconThemeData(color: Colors.black),
|
iconTheme: IconThemeData(color: Colors.black),
|
||||||
),
|
),
|
||||||
|
@ -63,25 +67,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
|
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
|
||||||
child: ListView(
|
child: ListView(
|
||||||
children: <Widget>[
|
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(
|
Container(
|
||||||
padding: EdgeInsets.fromLTRB(0.0,17,0.0,0.0),
|
padding: EdgeInsets.fromLTRB(0.0,17,0.0,0.0),
|
||||||
|
@ -99,7 +84,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new GroupedBarChart.withSampleData()
|
child: new GroupedBarChart.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -119,7 +103,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new BucketingAxisScatterPlotChart.withSampleData()
|
child: new BucketingAxisScatterPlotChart.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -159,7 +142,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new DonutAutoLabelChart.withSampleData()
|
child: new DonutAutoLabelChart.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -179,7 +161,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new DonutPieChart.withSampleData()
|
child: new DonutPieChart.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -199,7 +180,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new NumericComboLineBarChart.withSampleData()
|
child: new NumericComboLineBarChart.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -219,7 +199,6 @@ class StatsPageState extends State<StatsPage> {
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||||
height: 200,
|
height: 200,
|
||||||
// width: 250,
|
|
||||||
child: new LegendWithMeasures.withSampleData()
|
child: new LegendWithMeasures.withSampleData()
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
Reference in a new issue