From 2218422df4181403a111938f931c5c701d277e39 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 12 Aug 2019 10:33:02 +0100 Subject: [PATCH] new organisation dialog submitting started --- .../apifunctions/find_organisations.dart | 2 +- lib/common/widgets/organisations_dialog.dart | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/common/apifunctions/find_organisations.dart b/lib/common/apifunctions/find_organisations.dart index 4d441a3..772f37a 100644 --- a/lib/common/apifunctions/find_organisations.dart +++ b/lib/common/apifunctions/find_organisations.dart @@ -31,7 +31,7 @@ class Organisations { itemsList.add(new Organisation( i, "Payee " + (i + 1).toString(), - "eee eee", + "tee hee hee", "yeet street", "Robloxia" )); diff --git a/lib/common/widgets/organisations_dialog.dart b/lib/common/widgets/organisations_dialog.dart index ab8f374..2134fb7 100644 --- a/lib/common/widgets/organisations_dialog.dart +++ b/lib/common/widgets/organisations_dialog.dart @@ -39,6 +39,10 @@ class FindOrganisations { // }); } + _chosenOrg(Organisation chosen) { + debugPrint(chosen.name + " tapped"); + } + return showDialog( context: context, barrierDismissible: true, @@ -114,7 +118,7 @@ class FindOrganisations { width: MediaQuery .of(context) .size - .width * 0.7, + .width, height: MediaQuery .of(context) .size @@ -127,12 +131,20 @@ class FindOrganisations { itemCount: organisationsList.length, itemBuilder: (context, index) { return Card( - child: ListTile( - leading: Icon(Icons.person), - title: Text(organisationsList[index].name, style: new TextStyle(fontSize: 18)), - trailing: Icon(Icons.arrow_forward_ios), - onTap: () {}, - ) + child: ListTile( + 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]), + onTap: (){ + _chosenOrg(organisationsList[index]); + }, + onLongPress: (){ + // show more details about the organisation in a new dialog + + }, + ), ); }, ),