Skip to content
pubscout

widget_to_marker

1.0.6, released 2 years ago by an unverified publisher

Convert any Flutter widget into a Google Maps BitmapDescriptor for marker icons.

WASM-ready
$ flutter pub add widget_to_marker
Source repository

What it does

The package adds an extension that renders a widget to an image and creates a BitmapDescriptor. This allows custom widgets, including text and images, to be used as map markers.

AI-written summary of version 1.0.6, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need custom marker icons beyond static images
  • You want to display dynamic data or text on map markers
  • You prefer a Flutter‑only solution without native drawing code

Skip it when

  • Performance is critical for thousands of markers
  • You need offline rendering without a Flutter UI context

Strengths

  • Simple API with .toBitmapDescriptor()
  • Supports logical and image size control
  • Works on Android, iOS, and web

Weaknesses

  • May be slower for large or many markers
  • Relies on widget rendering which can fail for complex widgets

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
import 'package:widget_to_marker/widget_to_marker.dart';

Marker(
  markerId: const MarkerId('1'),
  position: const LatLng(30.0, 30.0),
  icon: await TextOnImage(text: 'Hello').toBitmapDescriptor(
    logicalSize: const Size(150, 150),
    imageSize: const Size(150, 150),
  ),
);

Alternatives

Packages that do the same job and could replace widget_to_marker.

Works with

Packages commonly used together with widget_to_marker: ones it builds on, ones built on it, and its own family.