Skip to content

Commit

Permalink
feat: launch google maps for location
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 committed Sep 7, 2019
1 parent c78c010 commit 58ee485
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/screens/user.dart
Expand Up @@ -115,8 +115,10 @@ class _UserScreenState extends State<UserScreen> {
return TableViewItem(
leftWidget: leftWidget,
text: itemText,
rightWidget: Icon(CupertinoIcons.right_chevron,
size: 18, color: PrimerColors.gray300),
rightWidget: onTap == null
? null
: Icon(CupertinoIcons.right_chevron,
size: 18, color: PrimerColors.gray300),
onTap: onTap,
);
}
Expand Down Expand Up @@ -263,10 +265,16 @@ class _UserScreenState extends State<UserScreen> {
text: payload['company'],
),
_buildTableViewItem(
iconData: Octicons.location,
placeholder: 'Location',
text: payload['location'],
),
iconData: Octicons.location,
placeholder: '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(
iconData: Octicons.mail,
placeholder: 'Email',
Expand Down

0 comments on commit 58ee485

Please sign in to comment.