From 9b34dd370d9aba1f6c135389daa4aa4ced2b6581 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 13 Aug 2019 12:36:10 +0100 Subject: [PATCH] added More Info dialog on long press of payee --- ios/Podfile.lock | 4 +- ios/Runner.xcodeproj/project.pbxproj | 2 +- lib/common/widgets/organisations_dialog.dart | 71 ++++++++++++++++++-- 3 files changed, 68 insertions(+), 9 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a4e1203..8132310 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -6,13 +6,13 @@ PODS: - Flutter DEPENDENCIES: - - Flutter (from `.symlinks/flutter/ios`) + - Flutter (from `.symlinks/flutter/ios-profile`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) EXTERNAL SOURCES: Flutter: - :path: ".symlinks/flutter/ios" + :path: ".symlinks/flutter/ios-profile" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" url_launcher: diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5b4844c..a0f8e33 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -281,7 +281,7 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework", + "${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( diff --git a/lib/common/widgets/organisations_dialog.dart b/lib/common/widgets/organisations_dialog.dart index 3c35499..1465aed 100644 --- a/lib/common/widgets/organisations_dialog.dart +++ b/lib/common/widgets/organisations_dialog.dart @@ -18,6 +18,69 @@ class FindOrganisations { // todo: get all organisations, favourites and all data from one 'organisations' class or similar // eg items: organisations.getFavourites().orderBy(name), + Future _moreInfoDialog(context, Organisation organisation) { + TextStyle informationTitleStyle = new TextStyle(fontSize: 16); + TextStyle informationStyle = new TextStyle(fontSize: 16, fontWeight: FontWeight.bold); + + return showDialog( + context: context, + barrierDismissible: true, + + builder: (BuildContext context) { + return StatefulBuilder( + builder: (context, setState) { + return SimpleDialog( + children: [ + Container( + padding: EdgeInsets.fromLTRB(10, 0, 10, 0), + child: Text( + organisation.name, + style: new TextStyle( + fontSize: 21, fontWeight: FontWeight.bold), + ), + ), + + Container( + padding: EdgeInsets.symmetric(horizontal: 10), + child: Divider(), + ), + + Container( + width: MediaQuery.of(context).size.width, + padding: EdgeInsets.symmetric(horizontal: 10), + child: Table( +// defaultColumnWidth: FixedColumnWidth(100), + children: [ + TableRow( + children: [ + Text("Street:", style: informationTitleStyle), + Text(organisation.streetName, style: informationStyle), + ], + ), + TableRow( + children: [ + Text("Postcode:", style: informationTitleStyle), + Text(organisation.postcode.toUpperCase(), style: informationStyle), + ], + ), + TableRow( + children: [ + Text("Town:", style: informationTitleStyle), + Text(organisation.town, style: informationStyle), + ], + ), + ], + ), + ), + + ], + ); + }, + ); + }, + ); + } + Future dialog(context) { bool _searchEnabled = false; TextEditingController searchBarText = new TextEditingController(); @@ -40,10 +103,6 @@ class FindOrganisations { // }); } - _chosenOrg(Organisation chosen) { -// debugPrint(chosen.name + " tapped"); - } - return showDialog( context: context, barrierDismissible: true, @@ -142,11 +201,11 @@ class FindOrganisations { // onTap: _chosenOrg(organisationsList[index]), onTap: (){ Navigator.of(context).pop(organisationsList[index]); - _chosenOrg(organisationsList[index]); }, onLongPress: (){ // show more details about the organisation in a new dialog - + var moreInfo = _moreInfoDialog(context, organisationsList[index]); + moreInfo.whenComplete(null); }, ), );