flutter_minimap

A small, focused minimap for Flutter's InteractiveViewer. It previews one finite-size canvas, tracks pan and zoom through a TransformationController, and can navigate the canvas by dragging the viewport on the minimap.

Demo

Below is a short example video demonstrating the minimap in the example app.


Section Layout

Theater Layout

Office Layout

Plan Layout
If the video does not appear, place the demo file at `example/example_1.mov` in this repository (the example video filename is `example_1.mov`).

Features

  • Live viewport tracking while panning and zooming
  • Optional viewport dragging
  • always, onInteraction, and hidden visibility modes
  • Fixed, intentional API surface for v0.1

Usage

final controller = TransformationController();

MiniMapViewer(
  controller: controller,
  width: 180,
  height: 120,
  alignment: Alignment.bottomRight,
  allowDrag: true,
  visibilityMode: MiniMapVisibility.always,
  child: const SizedBox(
    width: 2400,
    height: 1400,
    child: MyCanvas(),
  ),
)

MiniMapViewer owns the InteractiveViewer and uses the supplied controller. The child must resolve to a finite size; wrapping a canvas in SizedBox is the most predictable option. The child configuration is also rendered as the non-interactive minimap preview, so avoid child widgets that depend on a GlobalKey or have side effects when built twice.

Example

Run the example:

cd example && flutter run

flutter_mini

Maintainer

Maintained by Yash Fadadu.

Contributing

Found a bug or want to improve the package? Please register an issue or submit a pull request on the repository. Contributions, feature requests, and bug reports are welcome — open issues or contribute at https://github.com/yashh1994/flutter_minimap

Libraries

examples/theater_example
flutter_minimap
A lightweight minimap for Flutter's InteractiveViewer.