feat: launch google maps for location

This commit is contained in:
Rongjian Zhang 2019-09-07 16:45:04 +08:00
parent c78c010fab
commit 58ee48527f
1 changed files with 14 additions and 6 deletions

View File

@ -115,7 +115,9 @@ class _UserScreenState extends State<UserScreen> {
return TableViewItem( return TableViewItem(
leftWidget: leftWidget, leftWidget: leftWidget,
text: itemText, text: itemText,
rightWidget: Icon(CupertinoIcons.right_chevron, rightWidget: onTap == null
? null
: Icon(CupertinoIcons.right_chevron,
size: 18, color: PrimerColors.gray300), size: 18, color: PrimerColors.gray300),
onTap: onTap, onTap: onTap,
); );
@ -266,7 +268,13 @@ class _UserScreenState extends State<UserScreen> {
iconData: Octicons.location, iconData: Octicons.location,
placeholder: 'Location', placeholder: 'Location',
text: payload['location'], text: payload['location'],
), onTap: payload['location'] == null
? null
: () {
launch('https://www.google.com/maps/place/' +
(payload['location'] as String)
.replaceAll(RegExp(r'\s+'), ''));
}),
_buildTableViewItem( _buildTableViewItem(
iconData: Octicons.mail, iconData: Octicons.mail,
placeholder: 'Email', placeholder: 'Email',