osm_flutter_hooks 1.1.1 copy "osm_flutter_hooks: ^1.1.1" to clipboard
osm_flutter_hooks: ^1.1.1 copied to clipboard

this Package extension to add support manage hook state with osm_flutter

OSM_FLUTTER_HOOKS #

pub

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

example with osm map #


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


9
likes
0
pub points
78%
popularity

Publisher

unverified uploader

this Package extension to add support manage hook state with osm_flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_hooks, flutter_osm_plugin

More

Packages that depend on osm_flutter_hooks