General minor fixes

This commit is contained in:
Felix 2019-07-15 16:17:41 +01:00
parent 3af4908d5f
commit 7dd00349a8
2 changed files with 14 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import 'package:local_spend/common/widgets/popupListView.dart';
import 'package:local_spend/common/widgets/labeled_checkbox.dart'; import 'package:local_spend/common/widgets/labeled_checkbox.dart';
const URL = "https://flutter.io/"; const URL = "https://flutter.io/";
const demonstration = false; const demonstration = true;
class ReceiptPage extends StatefulWidget { class ReceiptPage extends StatefulWidget {
@override @override
@ -82,20 +82,21 @@ class ReceiptPageState extends State<ReceiptPage> {
// return object of type Dialog // return object of type Dialog
return AlertDialog( return AlertDialog(
title: new Text("Success"), title: new Text("Success"),
content: new Text("Recepit successfully submitted."), content: new Text("Receipt successfully submitted."),
actions: <Widget>[ actions: <Widget>[
// usually buttons at the bottom of the dialog // usually buttons at the bottom of the dialog
new FlatButton( new FlatButton(
child: new Text("OK"), child: new Text("OK"),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
//TODO: Reset form after dialog exit
}, },
), ),
], ],
); );
}, },
).then((_) { ).then((_) {
Navigator.of(context).pushNamed('/HomePage'); Navigator.of(context).pushReplacementNamed('/HomePage');
}); });
} }
else { else {
@ -166,6 +167,15 @@ class ReceiptPageState extends State<ReceiptPage> {
} }
String listOrganisations(List<Organisation> organisations, context) { String listOrganisations(List<Organisation> organisations, context) {
if (organisations.length == 0) {
showDialogSingleButton(
context,
"No matching organizations",
"We were unable to find any organizations matching this text.",
"OK"
);
return null;
}
var optionsList = new List<String>(); var optionsList = new List<String>();
for (var i = 0; i < organisations.length; i++) { for (var i = 0; i < organisations.length; i++) {

View file

@ -49,7 +49,7 @@ class _SplashScreenState extends State<SplashScreen> {
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 30.0), margin: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 30.0),
child: Text( child: Text(
"© Copyright Statement 2018", "© Copyright Statement 2019",
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
color: Colors.black, color: Colors.black,