I am trying to launch the map application according to the user's choice. But the google map on my mobile is opened, Before the bottom sheet that contains the list of apps opens. I want to wait until the user chooses the app. How do I achieve this?
This is my code to open the map, If the tasktype is address the
GestureDetector(
onTap: () async {
try {
launchUrl(
Uri.parse("geo:${address.lat},${address.lng}"),
mode: LaunchMode.externalApplication,
);
} finally {
launchUrl(Uri.parse(
"google.navigation:q=${address.lat},${address.lng}&mode=d"));
}
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
CommonText(
text: kLanguageList!.value.googleMaps.obs,
size: 1,
textColor: kGreen,
boldText: false,
underline: TextDecoration.underline,
),
Image.asset(
kGoogleMapLogo,
scale: 20,
),
],
),
),