搜索插件、代码仓与 APP 分类

flutter_map_animations 封面
插件详情v0.11.0

flutter_map_animations

flutter_map 包中标记和控件的动画工具。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
4.7万
喜欢数
120
Pub 分数
160

安装插件

flutter pub add flutter_map_animations

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 包,为 flutter_map 包中的标记和控件提供动画工具。它可实现地图元素的平滑过渡和动态视觉效果,通过响应式交互提升用户体验。专为与 flutter_map 无缝集成而设计,支持常见的动画模式,如位置变化、缩放调整和可见性过渡。适用于需要在多个平台上实现动画地图标记或交互式控件行为的应用程序。

适合场景

  • 动画地图标记
  • 交互式地图控件
  • 实时位置跟踪
  • 基于地图的仪表板
  • 用户界面增强
  • 动态地图叠加

主要特点

  • 平滑标记动画
  • 控制元素过渡
  • 与 flutter_map 的无缝集成
  • 跨平台支持
  • 可自定义的动画曲线
  • 轻量化且模块化设计

适合对象

  • 带有动态数据的地图
  • 交互式地理定位应用
  • 地图上的数据可视化
  • UI密集型映射界面
  • 使用 flutter_map 的开发者

使用建议

  • 需要 flutter_map 依赖
  • 仅限标记和控制动画
  • 大量动画元素带来的性能影响
  • 可能需要为复杂动画进行调优
  • 不适用于非地图UI组件

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目