Skip to content
pubscout

platform_maps_flutter

1.0.2, released 5 years ago by fluttercommunity.dev

Cross‑platform native map widget for Android and iOS using Google and Apple Maps.

$ flutter pub add platform_maps_flutter
Source repository

What it does

Provides a single PlatformMap widget that renders native maps on Android and iOS, supporting camera movement, markers, polylines, polygons, circles, and various map gestures.

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

Use it when

  • Need a native map on both Android and iOS with a unified API
  • Require markers, camera control, and custom info windows
  • Want to avoid web or hybrid map solutions

Skip it when

  • Only targeting a single platform
  • Using a web or Flutter web map
  • You need advanced map analytics or offline map tiles

Strengths

  • Native performance on both platforms
  • Unified API for markers, camera, and gestures
  • Supports custom marker images and info windows
  • Includes snapshot capability and memory‑leak fixes

Weaknesses

  • Requires Flutter embedded views preview (developer preview)
  • Setup involves platform‑specific configuration
  • Limited to Android and iOS only

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
3

Add API key to AndroidManifest.xml; add io.flutter.embedded_views_preview and location usage description to iOS Info.plist; ensure Google Maps API key and Apple Maps usage description are set.

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PlatformMap(
        initialCameraPosition: CameraPosition(
          target: const LatLng(47.6, 8.8796),
          zoom: 16.0,
        ),
        markers: Set<Marker>.of([
          Marker(
            markerId: MarkerId('marker_1'),
            position: LatLng(47.6, 8.8796),
            consumeTapEvents: true,
            infoWindow: InfoWindow(
              title: 'PlatformMarker',
              snippet: "Hi I'm a Platform Marker",
            ),
            onTap: () => print("Marker tapped"),
          ),
        ]),
        myLocationEnabled: true,
        myLocationButtonEnabled: true,
        onTap: (location) => print('onTap: $location'),
        onCameraMove: (cameraUpdate) => print('onCameraMove: $cameraUpdate'),
        compassEnabled: true,
        onMapCreated: (controller) {
          Future.delayed(Duration(seconds: 2)).then((_) {
            controller.animateCamera(
              CameraUpdate.newCameraPosition(
                const CameraPosition(
                  bearing: 270.0,
                  target: LatLng(51.5160895, -0.1294527),
                  tilt: 30.0,
                  zoom: 18,
                ),
              ),
            );
          });
        },
      ),
    );
  }
}

Alternatives

Packages that do the same job and could replace platform_maps_flutter.

Works with

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