Created
December 4, 2021 19:50
-
-
Save berkayoruc/f003313f5f5fd466f121727a1a84c75f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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