Coder Social home page Coder Social logo

sonole / flutter_map_animations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from testeurmaniak/flutter_map_animations

0.0 0.0 0.0 94.82 MB

Animation utility for flutter_map.

Home Page: https://testeurmaniak.github.io/flutter_map_animations/#/

License: MIT License

Objective-C 0.11% Kotlin 0.35% Dart 91.23% Swift 3.24% HTML 5.08%

flutter_map_animations's Introduction

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 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: _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

flutter_map_animations's People

Contributors

testeurmaniak avatar jaffaketchup avatar rorystephenson avatar github-actions[bot] avatar reinissprogis avatar sonole avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.