forgot to stage all the changes...

This commit is contained in:
Felix 2019-08-12 15:18:01 +01:00
parent cb75f1ff87
commit 3060a6d1f9
6 changed files with 65 additions and 53 deletions

View file

@ -6,13 +6,13 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`) - Flutter (from `.symlinks/flutter/ios-profile`)
- 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" :path: ".symlinks/flutter/ios-profile"
shared_preferences: shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios" :path: ".symlinks/plugins/shared_preferences/ios"
url_launcher: url_launcher:

View file

@ -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/Flutter.framework", "${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (

View file

@ -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/common/functions/show_dialog_single_button.dart';
import 'package:local_spend/model/json/login_model.dart'; import 'package:local_spend/model/json/login_model.dart';
Future<void> _incorrectDialog(BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return AlertDialog(
title: Text("Unable to Login"),
content: Text("Incorrect login details. Please try again."),
actions: <Widget>[
FlatButton(
child: Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
Future<LoginModel> requestLoginAPI( Future<LoginModel> requestLoginAPI(
BuildContext context, String email, String password) async { BuildContext context, String email, String password) async {
//var apiUrl = ConfigWrapper.of(context).apiKey; //var apiUrl = ConfigWrapper.of(context).apiKey;
@ -41,11 +62,7 @@ Future<LoginModel> requestLoginAPI(
saveCurrentLogin(responseJson, body["email"]); saveCurrentLogin(responseJson, body["email"]);
showDialogSingleButton( _incorrectDialog(context);
context,
"Unable to Login",
"You may have supplied an invalid 'Email' / 'Password' combination. Please try again or email an administrator.",
"OK");
return null; return null;
} }

View file

@ -71,9 +71,9 @@ class FindOrganisations {
} else { } else {
_searchEnabled = false; _searchEnabled = false;
} }
setState(() => {}); setState(() => {_searchEnabled});
}, },
onSubmitted: (value) { onSubmitted: (_) {
if (_searchEnabled) { if (_searchEnabled) {
var result = _submitSearch(searchBarText.text); var result = _submitSearch(searchBarText.text);
result.then((_) { result.then((_) {
@ -87,23 +87,20 @@ class FindOrganisations {
Container( Container(
width: 80, width: 80,
padding: EdgeInsets.fromLTRB(20, 0, 0, 0), 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), child: RaisedButton(
color: _searchEnabled ? Colors.blue : Colors.blue[200], onPressed: (() {
// make inactive when search in progress as activity indicator 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
), ),
), ),
], ],

View file

@ -109,12 +109,13 @@ class LoginPageState extends State<LoginPage> {
body: Container( body: Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
gradient: new LinearGradient( gradient: new LinearGradient(
colors: [Colors.white, Colors.blue[50]], colors: [Colors.blue[50], Colors.white],
stops: [0,1], stops: [0,1],
begin: Alignment.topCenter, begin: Alignment.topCenter,
end: Alignment.bottomCenter, end: Alignment.bottomCenter,
), ),
), child: Container( ),
child: Container(
margin: EdgeInsets.fromLTRB(60,30,60,0), margin: EdgeInsets.fromLTRB(60,30,60,0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -178,19 +179,6 @@ class LoginPageState extends State<LoginPage> {
child : Material( child : Material(
child: new Container( 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( decoration: new BoxDecoration(
border: new Border.all(color : Colors.transparent, width: 2), border: new Border.all(color : Colors.transparent, width: 2),
borderRadius: BorderRadius.all(Radius.circular(2)), borderRadius: BorderRadius.all(Radius.circular(2)),
@ -204,6 +192,24 @@ class LoginPageState extends State<LoginPage> {
end: Alignment.bottomRight, 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),),
),
),
),
),
), ),
), ),
), ),

View file

@ -439,14 +439,6 @@ class ReceiptPage2State extends State<ReceiptPage2> {
child: RaisedButton( child: RaisedButton(
onPressed: () { onPressed: () {
try { try {
/*
DateTime.now(),
new TextEditingController(),
new Organisation(null, null, null, null, null),
"None",
false,
"Uncategorised",
*/
if (transaction.amount.text == "" || transaction.organisation.name == null) { if (transaction.amount.text == "" || transaction.organisation.name == null) {
showDialog( showDialog(
context: context, context: context,
@ -459,10 +451,10 @@ class ReceiptPage2State extends State<ReceiptPage2> {
_submitReceipt(transaction); _submitReceipt(transaction);
} else { } else {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return _invalidDialog(context); return _invalidDialog(context);
} }
); );
} }
} }