nothing more to do..?
i believe that the app is finished. ta-da!
This commit is contained in:
parent
c288f257c5
commit
1353372743
1 changed files with 40 additions and 19 deletions
|
@ -75,8 +75,29 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
void submitReceipt(String amount, String time, Organisation organisation) async {
|
void submitReceipt(String amount, String time, Organisation organisation) async {
|
||||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||||
|
|
||||||
if (demonstration)
|
if (amount == "" || time == "" || organisation == null) {
|
||||||
{
|
await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
// return object of type Dialog
|
||||||
|
return AlertDialog(
|
||||||
|
title: new Text("Invalid data"),
|
||||||
|
content: new Text(
|
||||||
|
"We couldn't process your request because one or more required fields are missing."),
|
||||||
|
actions: <Widget>[
|
||||||
|
new FlatButton(
|
||||||
|
child: new Text("OK"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (demonstration) {
|
||||||
await showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
|
@ -91,15 +112,14 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
Navigator.of(context).pushReplacementNamed('/HomePage');
|
Navigator.of(context).pushReplacementNamed('/HomePage');
|
||||||
//TODO: Reset form after dialog exit
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
).then((_) {
|
).then((_) {});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
Receipt receipt = new Receipt();
|
Receipt receipt = new Receipt();
|
||||||
|
|
||||||
|
@ -123,6 +143,7 @@ class ReceiptPageState extends State<ReceiptPage> {
|
||||||
Navigator.of(context).pushReplacementNamed('/HomePage');
|
Navigator.of(context).pushReplacementNamed('/HomePage');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String convertBoolToString(bool toConvert) {
|
String convertBoolToString(bool toConvert) {
|
||||||
if (toConvert)
|
if (toConvert)
|
||||||
|
|
Reference in a new issue