From 9e4267148808c577358c113815352c4ec27eafe7 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 17 Jul 2019 12:54:31 +0100 Subject: [PATCH] side bar added, ran into weird problem --- ios/Podfile.lock | 4 +- ios/Runner.xcodeproj/project.pbxproj | 2 +- .../apifunctions/request_login_api.dart | 2 +- lib/pages/login_page.dart | 4 +- lib/pages/receipt_page.dart | 46 ++++++++++--------- 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 81f2036..f5bffe1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -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: diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index dff0209..a83a4d3 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -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 = ( diff --git a/lib/common/apifunctions/request_login_api.dart b/lib/common/apifunctions/request_login_api.dart index 2361c67..f5c4173 100644 --- a/lib/common/apifunctions/request_login_api.dart +++ b/lib/common/apifunctions/request_login_api.dart @@ -31,7 +31,7 @@ Future 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 { diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 74f7b95..62ba02a 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -92,9 +92,9 @@ class LoginPageState extends State { onWillPop: () { if (Navigator.canPop(context)) { Navigator.of(context).pushNamedAndRemoveUntil( - '/HomePage', (Route route) => false); + '/ReceiptPage', (Route route) => false); } else { - Navigator.of(context).pushReplacementNamed('/HomePage'); + Navigator.of(context).pushReplacementNamed('/ReceiptPage'); } }, child: PlatformScaffold( diff --git a/lib/pages/receipt_page.dart b/lib/pages/receipt_page.dart index 343072e..5ec1668 100644 --- a/lib/pages/receipt_page.dart +++ b/lib/pages/receipt_page.dart @@ -1,4 +1,5 @@ import 'dart:async'; +import 'dart:io' show Platform; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -143,7 +144,7 @@ class ReceiptPageState extends State { child: new Text("OK"), onPressed: () { Navigator.of(context).pop(); - Navigator.of(context).pushReplacementNamed("/HomePage"); + Navigator.of(context).pushReplacementNamed("/ReceiptPage"); }, ), ], @@ -169,7 +170,7 @@ class ReceiptPageState extends State { receipt.essential = essential; submitReceiptAPI(context, receipt); - Navigator.of(context).pushReplacementNamed("/HomePage"); + Navigator.of(context).pushReplacementNamed("/ReceiptPage"); } } } @@ -300,8 +301,10 @@ class ReceiptPageState extends State { @override Widget build(BuildContext context) { return PlatformScaffold( - + drawer: Drawer(), 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 +313,8 @@ class ReceiptPageState extends State { color: Colors.white, ), ), -// leading: BackButton(), centerTitle: true, - iconTheme: IconThemeData(color: Colors.black), +// iconTheme: IconThemeData(color: Colors.black), ), body: Container( @@ -542,23 +544,23 @@ class ReceiptPageState extends State { ), ), - Container( - padding: const EdgeInsets.fromLTRB(29, 0, 0, 0), - child: DropdownButton( - value: _categoryController.text, - onChanged: (String newValue) { - setState(() { - _categoryController.text = newValue; - }); - }, - items: _categoryDropDownItems.map>((String value) { - return DropdownMenuItem( - value: value, - child: Text(value), - ); - }).toList(), - ) - ), +// Container( +// padding: const EdgeInsets.fromLTRB(29, 0, 0, 0), +// child: DropdownButton( +// value: _categoryController.text, +// onChanged: (String newValue) { +// setState(() { +// _categoryController.text = newValue; +// }); +// }, +// items: _categoryDropDownItems.map>((String value) { +// return DropdownMenuItem( +// value: value, +// child: Text(value), +// ); +// }).toList(), +// ) +// ), ], ), ),