Skip to content
pubscout

flutter_map_mbtiles

1.1.0, released 3 weeks ago by joscha-eckert.de

Offline raster tile provider for flutter_map using MBTiles

$ flutter pub add flutter_map_mbtiles
Source repository

What it does

Provides a TileProvider that reads raster tiles (jpg, png, webp) from an MBTiles SQLite database. It can be used with flutter_map to display fully offline maps.

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

Use it when

  • You need offline map support with raster tiles
  • You already use flutter_map and want to avoid network requests
  • Your tile data is stored in an MBTiles file

Skip it when

  • You need vector tiles (use vector_map_tiles_mbtiles)
  • You target web platform (no SQLite support)

Strengths

  • Zero extra setup on supported platforms
  • Supports multiple raster formats
  • Easy integration with flutter_map

Weaknesses

  • Web not supported
  • Requires file system access and permissions
  • No vector tile support

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Add flutter_map_mbtiles to pubspec, provide path to .mbtiles file, call dispose() when done

final tileProvider = MbTilesTileProvider.fromPath(path: 'path/to/file.mbtiles');

@override
Widget build(BuildContext context) {
  return FlutterMap(
    options: const MapOptions(),
    children: [
      TileLayer(tileProvider: tileProvider),
    ],
  );
}

@override
void dispose() {
  tileProvider.dispose();
  super.dispose();
}

Alternatives

Packages that do the same job and could replace flutter_map_mbtiles.

Works with

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