diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a4e1203..8132310 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -6,13 +6,13 @@ PODS: - Flutter DEPENDENCIES: - - Flutter (from `.symlinks/flutter/ios`) + - Flutter (from `.symlinks/flutter/ios-profile`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) EXTERNAL SOURCES: Flutter: - :path: ".symlinks/flutter/ios" + :path: ".symlinks/flutter/ios-profile" 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 5b4844c..a0f8e33 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/Flutter.framework", + "${PODS_ROOT}/../.symlinks/flutter/ios-profile/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..27d3bdc 100644 --- a/lib/common/apifunctions/request_login_api.dart +++ b/lib/common/apifunctions/request_login_api.dart @@ -7,6 +7,27 @@ import 'package:local_spend/common/functions/save_current_login.dart'; import 'package:local_spend/common/functions/show_dialog_single_button.dart'; import 'package:local_spend/model/json/login_model.dart'; +Future _incorrectDialog(BuildContext context) async { + return showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return AlertDialog( + title: Text("Unable to Login"), + content: Text("Incorrect login details. Please try again."), + actions: [ + FlatButton( + child: Text('OK'), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); +} + Future requestLoginAPI( BuildContext context, String email, String password) async { //var apiUrl = ConfigWrapper.of(context).apiKey; @@ -41,11 +62,7 @@ Future requestLoginAPI( saveCurrentLogin(responseJson, body["email"]); - showDialogSingleButton( - context, - "Unable to Login", - "You may have supplied an invalid 'Email' / 'Password' combination. Please try again or email an administrator.", - "OK"); + _incorrectDialog(context); return null; } diff --git a/lib/common/widgets/organisations_dialog.dart b/lib/common/widgets/organisations_dialog.dart index 9666b96..3c35499 100644 --- a/lib/common/widgets/organisations_dialog.dart +++ b/lib/common/widgets/organisations_dialog.dart @@ -71,9 +71,9 @@ class FindOrganisations { } else { _searchEnabled = false; } - setState(() => {}); + setState(() => {_searchEnabled}); }, - onSubmitted: (value) { + onSubmitted: (_) { if (_searchEnabled) { var result = _submitSearch(searchBarText.text); result.then((_) { @@ -87,23 +87,20 @@ class FindOrganisations { Container( width: 80, padding: EdgeInsets.fromLTRB(20, 0, 0, 0), - child: IgnorePointer( - ignoring: _searchEnabled, - child: RaisedButton( - onPressed: () { - if (_searchEnabled) { - var result = _submitSearch( - searchBarText.text); - result.then((_) { - setState(() {}); - }); - } - }, - child: Icon(Icons.search, color: Colors.white), - color: _searchEnabled ? Colors.blue : Colors.blue[200], - // make inactive when search in progress as activity indicator - ), + child: RaisedButton( + onPressed: (() { + if (_searchEnabled) { + var result = _submitSearch(searchBarText.text); + result.then((_) { + setState(() {}); + }); + } + }), + + child: Icon(Icons.search, color: Colors.white), + color: _searchEnabled ? Colors.blue : Colors.blue[200], + // make inactive when search in progress as activity indicator ), ), ], diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart index 74f7b95..fc42e52 100644 --- a/lib/pages/login_page.dart +++ b/lib/pages/login_page.dart @@ -109,12 +109,13 @@ class LoginPageState extends State { body: Container( decoration: new BoxDecoration( gradient: new LinearGradient( - colors: [Colors.white, Colors.blue[50]], + colors: [Colors.blue[50], Colors.white], stops: [0,1], begin: Alignment.topCenter, end: Alignment.bottomCenter, ), - ), child: Container( + ), + child: Container( margin: EdgeInsets.fromLTRB(60,30,60,0), child: Column( children: [ @@ -178,19 +179,6 @@ class LoginPageState extends State { child : Material( child: new Container( - child : InkWell( - onTap: () => login( _emailController.text, _passwordController.text), - child: new Container( - width: 100, - height: 50, - child: new Center( - child: new Text( - 'GO', style: new TextStyle(fontSize: 18, color: Colors.white),), - ), - ), - splashColor: Colors.lightBlueAccent, - ), - decoration: new BoxDecoration( border: new Border.all(color : Colors.transparent, width: 2), borderRadius: BorderRadius.all(Radius.circular(2)), @@ -204,6 +192,24 @@ class LoginPageState extends State { end: Alignment.bottomRight, ), ), + + child : Material( + type: MaterialType.transparency, + + child : InkWell( + onTap: () => login( _emailController.text, _passwordController.text), + child: new Container( + width: 100, + height: 50, + child: new Center( + child: new Text( + 'GO', style: new TextStyle(fontSize: 18, color: Colors.white),), + ), + ), + ), + ), + + ), ), ), diff --git a/lib/pages/receipt_page_2.dart b/lib/pages/receipt_page_2.dart index 82e1331..897be0b 100644 --- a/lib/pages/receipt_page_2.dart +++ b/lib/pages/receipt_page_2.dart @@ -439,14 +439,6 @@ class ReceiptPage2State extends State { child: RaisedButton( onPressed: () { try { - /* - DateTime.now(), - new TextEditingController(), - new Organisation(null, null, null, null, null), - "None", - false, - "Uncategorised", - */ if (transaction.amount.text == "" || transaction.organisation.name == null) { showDialog( context: context, @@ -459,10 +451,10 @@ class ReceiptPage2State extends State { _submitReceipt(transaction); } else { showDialog( - context: context, - builder: (BuildContext context) { - return _invalidDialog(context); - } + context: context, + builder: (BuildContext context) { + return _invalidDialog(context); + } ); } }