v0.11.0flutter_map_animations
flutter_map 包中标记和控件的动画工具。
120喜欢 4.7万近 30 天下载160Pub 分数
AndroidiOSWebmacOSWindowsLinux
flutter_map 包中标记和控件的动画工具。
以下为英文项目原文快照,最新内容请访问 GitHub。
Animation utility for the flutter_map package.
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,
// ...
)
| Rotation | Zoom | Center on point |
|---|---|---|
![]() |
![]() |
![]() |
Check the AnimatedMapController API for more!
| 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,
);
},
),
],
),
],
)
With flutter_map v6 some parameters have been removed or renamed:
AnimatedMarker.rotateOrigin, AnimatedMarker.anchorPos have been removedAnimatedMarker.rotateAlignment has been renamed to AnimatedMarker.alignmentAnimatedMarkerLayer.rotateOrigin, AnimatedMarkerLayer.anchorPos have been removedAnimatedMarkerLayer.rotateAlignment has been renamed to AnimatedMarkerLayer.alignmentMapControllerImpl 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,
// ...
);
}
|
Guillaume Roux |
Luka S |
Rory Stephenson |
Reinis Sprogis |
依赖清单 5 项
{"sdk":"flutter"}^8.3.0>=0.9.1 <0.11.0^3.0.0{"sdk":"flutter"}先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗