flutter_map_animations 0.2.2 copy "flutter_map_animations: ^0.2.2" to clipboard
flutter_map_animations: ^0.2.2 copied to clipboard

Animation utilities for markers and controls of the flutter_map package.

Flutter Map Animations #

Pub Version

Animation utility for the flutter_map package.

You can try the example app here.

AnimatedMapController #

Just create an AnimatedMapController and you're good to go:

class _MyWidgetState extends State<MyWidget> with TickerProviderStateMixin {
    late final _mapController = AnimatedMapController(vsync: this);

    // ...
}

You can specify the animation duration and curve:

AnimatedMapController(
    vsync: this,
    duration: const Duration(milliseconds: 500),
    curve: Curves.easeInOut,
);

And add it to your FlutterMap widget:

FlutterMap(
    mapController: _mapController,
    // ...
)

Animated Movement #

All those methods are accessible from the AnimatedMapController:

  • animateTo({LatLng? dest, double? zoom, double? rotation, Curve? curve})
  • animatedRotateFrom(double degree, {Curve? curve})
  • animatedRotateTo(double degree, {Curve? curve})
  • animatedRotateReset({Curve? curve})
  • animatedZoomTo(double newZoom, {Curve? curve})
  • animatedZoomIn({Curve? curve})
  • animatedZoomOut({Curve? curve})
  • centerOnPoint(LatLng point, {double? zoom, Curve? curve})
  • centerOnPoints(List<LatLng> points, {FitBoundsOptions? options, Curve? curve})
  • animatedFitBounds(LatLngBounds bounds, {FitBoundsOptions? options, Curve? curve})

AnimatedMarkerLayer & AnimatedMarker #

FlutterMap(
    mapController: _mapController,
    children: [
        TileLayer(
            urlTemplate: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
            userAgentPackageName: 'com.example.app',
        ),
        AnimatedMarkerLayer(
            markers: [
                AnimatedMarker(
                    point: LatLng(51.509364, -0.128928),
                    builder: (_, __) => Icon(Icons.location_on),
                ),
            ],
        ),
    ],
)

Contributors #

62
likes
0
pub points
96%
popularity

Publisher

verified publisherrouxguillau.me

Animation utilities for markers and controls of the flutter_map package.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_map, latlong2

More

Packages that depend on flutter_map_animations