Customized google map with widget markers. Enables to show markers with widget code.

Related tags

Map map
Overview

widget_marker_google_map

pub package License: MIT

Google map with widget markers.

Set up

Follow the steps on google_maps_flutter document.

Usage

Same as google_maps_flutter except for widgetMarkers.

 WidgetMarkerGoogleMap(
    initialCameraPosition: shibuya,
    mapType: MapType.normal,
    widgetMarkers: [
      WidgetMarker(
        position: cafePosition,
        markerId: 'cafe',
        widget: Container(
          color: Colors.brown,
          padding: const EdgeInsets.all(2),
          child: const Icon(
            Icons.coffee,
            color: Colors.white,
            size: 64,
          ),
        ),
      ),
      WidgetMarker(
        position: clothesShopPosition,
        markerId: 'clothes',
        widget: Container(
          color: Colors.green,
          padding: const EdgeInsets.all(4),
          child: const Text(
            'shop',
            style: TextStyle(
              color: Colors.white,
              fontWeight: FontWeight.bold,
              fontSize: 32,
            ),
          ),
        ),
      ),
      WidgetMarker(
        position: hamburgerShopPosition,
        markerId: 'hamburger',
        widget: Container(
          color: Colors.red,
          padding: const EdgeInsets.all(2),
          child: const Icon(
            Icons.fastfood,
            color: Colors.yellow,
            size: 64,
          ),
        ),
      ),
    ],
  ),

WidgetMarker

You need to insert the list of WidgetMarker to use widget markers.

Make sure that you still need to use onTap method when you use gestures.

class WidgetMarker {
  WidgetMarker({
    required this.position,
    required this.markerId,
    required this.widget,
    this.onTap,
  }) : assert(markerId.isNotEmpty);

  final LatLng position;

  /// Keep this unique, otherwise it will not appear.
  final String markerId;

  /// Gestures of widget is disabled.
  /// Use this callback instead.
  final VoidCallback? onTap;

  final Widget widget;
}

If you have any requests or questions, feel free to ask on github.

You might also like...

A Flutter map widget inspired by Leaflet

flutter_map A Dart implementation of Leaflet for Flutter apps. Installation Add flutter_map to your pubspec: dependencies: flutter_map: any # or the

Dec 28, 2022

A map widget with live position updates for Flutter

A map widget with live position updates for Flutter

Livemap A map widget with live position updates. Based on Flutter map and Geolocator. Provides a controller api to handle map state changes. Example i

Sep 28, 2022

A Flutter map widget inspired by Leaflet

flutter_map A Dart implementation of Leaflet for Flutter apps. Usage Add flutter_map to your pubspec: dependencies: flutter_map: any # or the latest

Dec 13, 2022

A Flutter map widget inspired by Leaflet

flutter_map A Dart implementation of Leaflet for Flutter apps. Installation Add flutter_map to your pubspec: dependencies: flutter_map: any # or the

Jan 3, 2023

Google Places - Google places autocomplete widgets for flutter.

Google Places - Google places autocomplete widgets for flutter.

flutter_google_places Google places autocomplete widgets for flutter. Getting Started For help getting started with Flutter, view our online documenta

Jan 5, 2023

A migration of Google Maps Application with Flutter & Google Maps APIs including: Maps SDK for Android & IOS, Places API & polylines

google_maps A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Mar 4, 2022

A flutter package for select a city from svg map.

A flutter package for select a city from svg map.

City Picker From Map A flutter package for select a city from svg map. Supported countries (+150) are here. Screenshots Getting Started In the pubspec

Nov 17, 2022

Map Picker for Flutter

Map Picker for Flutter

Map Pin Picker A Vendor-free map Library for Easy and Quick Usage. Follow the steps to integrate Google Maps (https://pub.dev/packages/google_maps_flu

Jul 15, 2022

A new flutter plugin for mapbox. You can use it for your map backgrounds inside flutter applications

A new flutter plugin for mapbox. You can use it for your map backgrounds inside flutter applications

A new flutter plugin for mapbox. You can use it for your map backgrounds inside flutter applications

Sep 14, 2022
Comments
  • Got runtime error

    Got runtime error

    Hi this plugins is very useful, it still in maintenance?

    ======== Exception caught by scheduler library =====================================================
    The following assertion was thrown during a scheduler callback:
    'package:flutter/src/rendering/binding.dart': Failed assertion: line 384 pos 12: '!_debugMouseTrackerUpdateScheduled': is not true.
    
    Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
    In either case, please report this assertion by filing a bug on GitHub:
      https://github.com/flutter/flutter/issues/new?template=2_bug.md
    
    When the exception was thrown, this was the stack: 
    #2      RendererBinding._scheduleMouseTrackerUpdate (package:flutter/src/rendering/binding.dart:384:12)
    #3      RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:379:5)
    #4      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1175:15)
    #5      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1104:9)
    #6      SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1015:5)
    #7      _invoke (dart:ui/hooks.dart:148:13)
    #8      PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:318:5)
    #9      _drawFrame (dart:ui/hooks.dart:115:31)
    (elided 2 frames from class _AssertionError)
    ====================================================================================================
    
    opened by alejandrogiubel 0
  • Changing WidgetMarker RawPicture for the marker

    Changing WidgetMarker RawPicture for the marker

    Hi, I put my map on a ScrollView, quite in the bottom. The RawPicture for repaint is showing on the upper of the scrolling view. Is there any parameter to move it off screen?

    blue pin under back button

    opened by davey06 0
  • Got runtime error on flutter 2.8.1

    Got runtime error on flutter 2.8.1

    Hi,

    I tried using this plugin, but when I run the example code using flutter 2.8.1, i got runtime error :

    E/flutter (27100): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Concurrent modification during iteration: Instance(length:2) of '_GrowableList'. E/flutter (27100): #0 ListIterator.moveNext (dart:_internal/iterable.dart:336) E/flutter (27100): #1 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1081) E/flutter (27100): #2 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996) E/flutter (27100): #3 _rootRun (dart:async/zone.dart:1428) E/flutter (27100): #4 _CustomZone.run (dart:async/zone.dart:1328) E/flutter (27100): #5 _CustomZone.runGuarded (dart:async/zone.dart:1236) E/flutter (27100): #6 _invoke (dart:ui/hooks.dart:150) E/flutter (27100): #7 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270) E/flutter (27100): #8 _drawFrame (dart:ui/hooks.dart:114) E/flutter (27100): E/flutter (27100): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Null check operator used on a null value E/flutter (27100): #0 RenderRepaintBoundary.toImage (package:flutter/src/rendering/proxy_box.dart:3157) E/flutter (27100): #1 _MarkerGeneratorState._convertToMarker (package:widget_marker_google_map/src/components/marker_generator.dart:28) E/flutter (27100): #2 _MarkerGeneratorState.onBuildCompleted. (package:widget_marker_google_map/src/components/marker_generator.dart:52) E/flutter (27100): #3 MappedListIterable.elementAt (dart:_internal/iterable.dart:413) E/flutter (27100): #4 ListIterator.moveNext (dart:_internal/iterable.dart:342) E/flutter (27100): #5 Future.wait (dart:async/future.dart:471) E/flutter (27100): #6 _MarkerGeneratorState.onBuildCompleted (package:widget_marker_google_map/src/components/marker_generator.dart:52) E/flutter (27100): #7 _MarkerGeneratorState.initState. (package:widget_marker_google_map/src/components/marker_generator.dart:43) E/flutter (27100): #8 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1145) E/flutter (27100): #9 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1082) E/flutter (27100): #10 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:996) E/flutter (27100): #11 _rootRun (dart:async/zone.dart:1428) E/flutter (27100): #12 _CustomZone.run (dart:async/zone.dart:1328) E/flutter (27100): #13 _CustomZone.runGuarded (dart:async/zone.dart:1236) E/flutter (27100): #14 _invoke (dart:ui/hooks.dart:150) E/flutter (27100): #15 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:270) E/flutter (27100): #16 _drawFrame (dart:ui/hooks.dart:114) E/flutter (27100):

    Is there any way to fix it?

    Thank you.

    opened by blackbusters 4
Owner
Santa Takahashi
Flutter developer. Waseda university undergraduate.
Santa Takahashi
How To Integrate Customized Google Map in Flutter

How To Integrate Customized Google Map in Flutter Let’s develop a customised Google Maps for the best user experience. Visit : https://medium.com/flut

Jaimil Patel 19 Dec 6, 2022
Flutter package to enable clustering of location markers on Google Maps using widgets specific to each location.

flutter_google_maps_widget_cluster_markers This widget implements a very specific adaptation of google_maps_cluster_manager, allowing different ,marke

Kek Tech 2 Jan 6, 2023
Stateful map controller for Flutter Map

Map controller Stateful map controller for Flutter Map. Manage markers, lines and polygons. View the web demo Usage import 'dart:async'; import 'packa

null 55 Sep 15, 2022
A map tour guide mobile app based on Flutter, an AI travel notes product integrating map tour guide and UGC.

A map tour guide mobile app based on Flutter, an AI travel notes product integrating map tour guide and UGC. Through the combination of 5g + AI, colle

null 24 Jan 14, 2022
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 pac

Atiq Samtia 95 Dec 28, 2022
A Flutter example to use Google Maps in iOS and Android apps via the embedded Google Maps plugin Google Maps Plugin

maps_demo A Flutter example to use Google Maps in iOS and Android apps via the embedded Google Maps plugin Google Maps Plugin Getting Started Get an A

Gerry High 41 Feb 14, 2022
Flutter Tutorial - Google Map with Live Location Tracking

Flutter Tutorial - Google Map with Live Location Tracking Build Google Map app with Live Location Tracking in Flutter. ✌   App Preview Android Preview

Samuel Adekunle 10 Dec 22, 2022
Flutter Google Map Example - Day 41

Flutter Google Map Example - Day 41 class Afgprogrammer extends Flutter100DaysOfCode { video() { return { "title": "Flutter Google Map Exa

Mohammad Rahmani 74 Jan 3, 2023
Flutter Google Map Example

Flutter Google Map Example A Flutter application demonstrate google map. Preview Listener and Marker Compass MapTypes Plugin google_maps_flutter from

Bhavik Makwana 67 Sep 14, 2021
A google map example for flutter

Flutter Google Map Example - Day 41 class Afgprogrammer extends Flutter100DaysOf

Behruz Hurramov 5 Nov 24, 2022