Search packages, repositories and app categories

flutter_map_animations cover
Package detailsv0.11.0

flutter_map_animations

Animation utilities for markers and controls of the flutter_map package.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
46.7K
Likes
120
Pub points
160

Install package

flutter pub add flutter_map_animations

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package providing animation utilities for markers and controls in the flutter_map package. It enables smooth transitions and dynamic visual effects for map elements, enhancing user experience with responsive interactions. Designed to integrate seamlessly with flutter_map, it supports common animation patterns like position changes, scale adjustments, and visibility transitions. Ideal for applications requiring animated map markers or interactive control behaviors across multiple platforms.

Use cases

  • Animated map markers
  • Interactive map controls
  • Real-time location tracking
  • Map-based dashboards
  • User interface enhancements
  • Dynamic map overlays

Key features

  • Smooth marker animations
  • Control element transitions
  • Seamless integration with flutter_map
  • Cross-platform support
  • Customizable animation curves
  • Lightweight and modular design

Suitable for

  • Maps with dynamic data
  • Interactive geolocation apps
  • Data visualization on maps
  • UI-heavy mapping interfaces
  • Developers using flutter_map

Considerations

  • Requires flutter_map dependency
  • Limited to marker and control animations
  • Performance impact with many animated elements
  • May require tuning for complex animations
  • Not suitable for non-map UI components

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Flutter Map Animations

Pub Version (including pre-releases)

Animation utility for the flutter_map package.

Try the example app

Table of Contents

Documentation

AnimatedMapController

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

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

    // ...
}

You can specify globally the animation's duration, curve and if previous animations should be stopped with cancelPreviousAnimations:

AnimatedMapController(
    vsync: this,
    duration: const Duration(milliseconds: 500),
    curve: Curves.easeInOut,
    cancelPreviousAnimations: true, // Default to false
);

And add it to your FlutterMap widget:

FlutterMap(
    mapController: _animatedMapController.mapController,
    // ...
)
Animated Movement
Rotation Zoom Center on point

Check the AnimatedMapController API for more!

AnimatedMarkerLayer & AnimatedMarker

AnimatedMarker
FlutterMap(
    mapController: _animatedMapController.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: (_, animation) {
                        final size = 50.0 * animation.value;
                        return Icon(
                            Icons.location_on,
                            size: size,
                        );
                    },
                ),
            ],
        ),
    ],
)

Migration Guide

v0.5.0

With flutter_map v6 some parameters have been removed or renamed:

  • AnimatedMarker.rotateOrigin, AnimatedMarker.anchorPos have been removed
  • AnimatedMarker.rotateAlignment has been renamed to AnimatedMarker.alignment
  • AnimatedMarkerLayer.rotateOrigin, AnimatedMarkerLayer.anchorPos have been removed
  • AnimatedMarkerLayer.rotateAlignment has been renamed to AnimatedMarkerLayer.alignment

v0.4.0

  • With flutter_map v5 it's not possible anymore to extend MapControllerImpl which was used to use the AnimatedMapController directly as a MapController in the FlutterMap widget. Now an instance of MapController is created internally or can be passed as a parameter to the AnimatedMapController constructor. You can access it with the mapController getter:
late final _animatedMapController = AnimatedMapController(vsync: this);

@override
Widget build(BuildContext context) {
    return FlutterMap(
        mapController: _animatedMapController.mapController,
        // ...
    );
}

Contributors

TesteurManiak
Guillaume Roux
JaffaKetchup
Luka S
rorystephenson
Rory Stephenson
ReinisSprogis
Reinis Sprogis

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package