dialog looks slightly better

This commit is contained in:
Felix 2019-08-19 11:19:41 +01:00
parent aa40a5c926
commit 2e1b74a222

View file

@ -86,7 +86,6 @@ class FindOrganisations {
TextEditingController searchBarText = new TextEditingController();
var organisations = new Organisations();
var listTitle = "All Organisations";
// var organisationsList = organisations.getTestData();
var organisationsList = List<Organisation>();
Future<int> _submitSearch(String search) async {
@ -94,13 +93,9 @@ class FindOrganisations {
listTitle = "Results for \'" + search + "\'";
var futureOrgs = await organisations.findOrganisations(search);
// futureOrgs.then((value) {
// debugPrint("There are " + futureOrgs.length.toString() +
// " payees matching the query \'" + search + "\'.");
organisationsList = futureOrgs;
_searchEnabled = true;
return futureOrgs.length;
// });
}
return showDialog<Organisation>(
@ -166,6 +161,8 @@ class FindOrganisations {
),
),
Column(
children: organisationsList.length > 0 ? [
Container(
padding: EdgeInsets.fromLTRB(20, 20, 20, 0),
child: Text(
@ -197,8 +194,8 @@ class FindOrganisations {
leading: Icon(Icons.person),
title: Text(organisationsList[index].name, style: new TextStyle(fontSize: 18)),
subtitle: Text(organisationsList[index].postcode.toUpperCase()),
// trailing: Icon(Icons.arrow_forward_ios),
// onTap: _chosenOrg(organisationsList[index]),
// trailing: Icon(Icons.arrow_forward_ios),
// onTap: _chosenOrg(organisationsList[index]),
onTap: (){
Navigator.of(context).pop(organisationsList[index]);
},
@ -213,7 +210,8 @@ class FindOrganisations {
),
),
),
] : [ Container(), ],
),
// help button for if org not listed
// cancel and ok buttons