showInteractiveMap function
Future<void>
showInteractiveMap(
- BuildContext context, {
- required GeoLocation initialLocation,
- String? title,
- required List<
Polygon< polygons,Object> > - double? initialZoom,
- OnPolygonHit? onPolygonHit,
Helper function to navigate to the interactive map page
Implementation
Future<void> showInteractiveMap(
BuildContext context, {
required GeoLocation initialLocation,
String? title,
required List<Polygon> polygons,
double? initialZoom,
OnPolygonHit? onPolygonHit,
}) async {
if (!context.mounted) return;
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) => InteractiveMapPage(
initialLocation: initialLocation,
title: title ?? 'Iraq Location Picker',
polygons: polygons,
initialZoom: initialZoom ?? defaultMapZoom,
onPolygonHit: onPolygonHit,
),
),
);
}