Skip to content

Instantly share code, notes, and snippets.

@berkayoruc
Created December 4, 2021 19:50
Show Gist options
  • Save berkayoruc/f003313f5f5fd466f121727a1a84c75f to your computer and use it in GitHub Desktop.
Save berkayoruc/f003313f5f5fd466f121727a1a84c75f to your computer and use it in GitHub Desktop.
void openMapSheet(context, lat, lng, title) async {
try {
final availableMaps = await MapLauncher.installedMaps;
showModalBottomSheet(
context: context,
builder: (context) {
return SafeArea(
child: SingleChildScrollView(
child: Wrap(
children: availableMaps
.map<ListTile>((e) => ListTile(
onTap: () => e.showMarker(
coords: Coords(lat, lng), title: title),
title: Text(e.mapName),
))
.toList(),
),
));
});
} catch (e) {
debugPrint(e.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment