added More Info dialog on long press of payee

This commit is contained in:
Felix 2019-08-13 12:36:10 +01:00
parent 2734131f08
commit 9b34dd370d
3 changed files with 68 additions and 9 deletions

View file

@ -6,13 +6,13 @@ PODS:
- Flutter - Flutter
DEPENDENCIES: DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`) - Flutter (from `.symlinks/flutter/ios-profile`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
Flutter: Flutter:
:path: ".symlinks/flutter/ios" :path: ".symlinks/flutter/ios-profile"
shared_preferences: shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios" :path: ".symlinks/plugins/shared_preferences/ios"
url_launcher: url_launcher:

View file

@ -281,7 +281,7 @@
); );
inputPaths = ( inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", "${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"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputPaths = (

View file

@ -18,6 +18,69 @@ class FindOrganisations {
// todo: get all organisations, favourites and all data from one 'organisations' class or similar // todo: get all organisations, favourites and all data from one 'organisations' class or similar
// eg items: organisations.getFavourites().orderBy(name), // eg items: organisations.getFavourites().orderBy(name),
Future<dynamic> _moreInfoDialog(context, Organisation organisation) {
TextStyle informationTitleStyle = new TextStyle(fontSize: 16);
TextStyle informationStyle = new TextStyle(fontSize: 16, fontWeight: FontWeight.bold);
return showDialog<Organisation>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return StatefulBuilder(
builder: (context, setState) {
return SimpleDialog(
children: <Widget>[
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<Organisation> dialog(context) { Future<Organisation> dialog(context) {
bool _searchEnabled = false; bool _searchEnabled = false;
TextEditingController searchBarText = new TextEditingController(); TextEditingController searchBarText = new TextEditingController();
@ -40,10 +103,6 @@ class FindOrganisations {
// }); // });
} }
_chosenOrg(Organisation chosen) {
// debugPrint(chosen.name + " tapped");
}
return showDialog<Organisation>( return showDialog<Organisation>(
context: context, context: context,
barrierDismissible: true, barrierDismissible: true,
@ -142,11 +201,11 @@ class FindOrganisations {
// onTap: _chosenOrg(organisationsList[index]), // onTap: _chosenOrg(organisationsList[index]),
onTap: (){ onTap: (){
Navigator.of(context).pop(organisationsList[index]); Navigator.of(context).pop(organisationsList[index]);
_chosenOrg(organisationsList[index]);
}, },
onLongPress: (){ onLongPress: (){
// show more details about the organisation in a new dialog // show more details about the organisation in a new dialog
var moreInfo = _moreInfoDialog(context, organisationsList[index]);
moreInfo.whenComplete(null);
}, },
), ),
); );