Giter Site home page Giter Site logo

kundan333 / interactive_maps_marker_flutter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from atiqsamtia/interactive_maps_marker_flutter

0.0 0.0 0.0 3.09 MB

Easy to use Animated Maps Markers with a detail card. Use it for a store or any place locator.

Home Page: https://pub.dev/packages/interactive_maps_marker

License: MIT License

Objective-C 0.20% Kotlin 0.64% Dart 97.06% Swift 2.10%

interactive_maps_marker_flutter's Introduction

interactive_maps_marker for Flutter

Easy to use Animated Maps Markers with detail card. Use it for store or any place locator.

Demo

Usage

Add this package to your pubspec.yaml in dependencies: section

dependencies: 
  interactive_maps_marker: ^0.0.2

This package depends upon google_maps_flutter so first setup this by following This Guide

Update dependencies

flutter pub get

You can now add a InteractiveMapsMarker widget to your widget tree.

Simple Usage

In your widget import the package and use InteractiveMapsMarker Widget

Example

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:interactive_maps_marker/interactive_maps_marker.dart';

class ExplorePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {

    return InteractiveMapsMarker(
      items: <MarkerItem>[
        MarkerItem(id: 1, latitude: 31.4673274, longitude: 74.2637687),
        MarkerItem(id: 2, latitude: 31.4718461, longitude: 74.3531591),
      ],
      center: LatLng(31.4906504, 74.319872),
      itemContent: (context, index) {
        return Text("Current Item $index");
      },
    );

  }
}

Advanced Usage

Coming Soon

Markers data from a remote server?

Use this widget inside a stateful widget and update the markers list state with new data. An example can be found in stateful_example.dart file in example project.

Customise with parameters

You can customise it by passing various parameter values. Details about all parameters is as follows.

Parameter Type Default Value Description
items List<MarkerItem> none List of Markers with type of MarkerItem. This parameter is required and cannot be null.
itemContent IndexedWidgetBuilder none This is builder function which will receive context and index. You must return a Widget which will show on a pre designed container. This is exactly like you use ListView Builder. Not applicable when using itemBuilder
center LatLng LatLng(0.0, 0.0) Center point for initial map display.
zoom double 12.0 Default zoom value for initial map screen.
itemHeight double 116.0 Height of your detail item. Not applicable when using itemBuilder
itemPadding EdgeInsetsGeometry EdgeInsets.only(bottom: 80.0) Padding for item detail card. Mainly used for bottom padding.
itemPadding Alignment Alignment.bottomCenter Alignment for content slider.
itemBuilder IndexedWidgetBuilder null If you don't want default container and want to build the bottom widget yourself, you can use this builder instead of itemContent and have full control over UI. This is builder function which will receive context and index. You must return a Widget.
controller InteractiveMapsController null A controller if you want to add the markers later and then call rebuild() or change the index of marker to animate with your action via setCurrentIndex(int index).

Meta

Atiq Samtia– @AtiqSamtia[email protected]

Distributed under the MIT license.

https://github.com/atiqsamtia/interactive_maps_marker_flutter

Credits

Inspired by amazing work from Mohamed Douzane

Github Repo

Medium Post

Contributing

  1. Fork it (https://github.com/atiqsamtia/interactive_maps_marker_flutter/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

interactive_maps_marker_flutter's People

Contributors

atiqsamtia avatar kundan333 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.