safer code
This commit is contained in:
parent
2218422df4
commit
9cba3e037c
2 changed files with 7 additions and 3 deletions
|
@ -23,7 +23,8 @@ class FindOrganisations {
|
||||||
TextEditingController searchBarText = new TextEditingController();
|
TextEditingController searchBarText = new TextEditingController();
|
||||||
var organisations = new Organisations();
|
var organisations = new Organisations();
|
||||||
var listTitle = "All Organisations";
|
var listTitle = "All Organisations";
|
||||||
var organisationsList = organisations.getTestData();
|
// var organisationsList = organisations.getTestData();
|
||||||
|
var organisationsList = List<Organisation>();
|
||||||
|
|
||||||
Future<int> _submitSearch(String search) async {
|
Future<int> _submitSearch(String search) async {
|
||||||
_searchEnabled = false;
|
_searchEnabled = false;
|
||||||
|
|
|
@ -150,8 +150,11 @@ class ReceiptPage2State extends State<ReceiptPage2> {
|
||||||
var organisations = new FindOrganisations();
|
var organisations = new FindOrganisations();
|
||||||
var orgDialog = organisations.dialog(context);
|
var orgDialog = organisations.dialog(context);
|
||||||
orgDialog.then((organisation) {
|
orgDialog.then((organisation) {
|
||||||
setState(() => {});
|
try {
|
||||||
debugPrint(organisation.name);
|
debugPrint(organisation.name);
|
||||||
|
} catch(_) {
|
||||||
|
debugPrint("No organisation chosen.");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
|
|
Reference in a new issue