osm_flutter_hooks

Last updated:

0 purchases

osm_flutter_hooks Image
osm_flutter_hooks Images
Add to Cart

Description:

osm flutter hooks

OSM_FLUTTER_HOOKS #

Features #

predefined hooks to manage osm map

Getting started #
you should already have osm_flutter package if you want to use flutter_hooks to manage state of your widgets (like osm) use this package
Usage #
add this line in you pubspec
dependencies:
osm_flutter_hooks: #latest
copied to clipboard
example with osm map #

class SimpleOSM extends HookWidget {
@override
Widget build(BuildContext context) {
final controller = useMapController(initMapWithUserPosition: const UserTrackingOption());
useMapIsReady(
controller: controller,
mapIsReady: () async {
await controller.setZoom(zoomLevel: 15);
},
);
useMapListener(
controller: controller,
onSingleTap: (p) async {
await controller.addMarker(p);
});
return OSMFlutter(
controller: controller,
markerOption: MarkerOption(
defaultMarker: MarkerIcon(
icon: Icon(
Icons.person_pin_circle,
color: Colors.blue,
size: 56,
),
),
),
trackMyPosition: false,
);
}
}


copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.