• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 4 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

More Repositories

1

WordPress-App-with-Flutter

Fully Functional IOS/Android App for WordPress Website with Flutter
Dart
166
star
2

change_app_package_name

Change App Package Name with single command. It makes the process very easy and fast.
Dart
123
star
3

hivedb_flutter_saved_list_sample

Sample for Getting list of saved items in a box.
Dart
6
star
4

Instagram-Profile-Picture-Downloader---instaDP

Download profile picture of instagram user in full size.
Java
4
star
5

mysql-server-manager-node

Manage and run MySQL Server built in node
JavaScript
3
star
6

firebase_ui_sample

C++
3
star
7

dart-ray

Debug with Ray to fix problems faster in Dart & flutter
Dart
3
star
8

adsense-clicks-controller

By Using this script you can Prevent your visitors to multiple click on your Ads. in this version Your visitors can only click one time per day on the ad.
PHP
2
star
9

WP-Post-Update-Date-All

Change the Post Update date for all posts in one click. This will help your blog in search engines and your blog will look alive. Do this every week or month. (Tip By Waqas Jawed in Bloggers Funda - facebook group)
PHP
2
star
10

atiqsamtia

1
star
11

atiqsamtia.github.io

My Intro Page at atiqsamtia.github.io
CSS
1
star
12

android-drawer-navigation-with-fragments

Java
1
star
13

espn-cricinfo-scrapper-php

ESPN CricInfo Website data Scrapper in PHP
PHP
1
star
14

restrict-adblocker

Restrict any ad blocker from your website
1
star
15

Retrofit-Codeigniter-Android-PHP-Login

Java
1
star
16

CricInfo-Scores

PHP
1
star
17

Messenger-Bot-Response-Handler

PHP
1
star
18

black-lives-matter-wordpress-widget

Floating Widget for solidarity with Black Lives Matter Campaign
PHP
1
star