A Flutter package for registering app routes and visualizing them as an interactive graph.
| Class | Description |
|---|---|
MRouteItem |
Wraps a screen, optionally with typed arguments |
MRouteEdge |
Connection between two route items |
MRouteRegistry |
Abstract class — declare all routes and edges here |
MapRouteScreen |
Visual navigator with list, grouped list, and graph views |
1. Define the registry
class AppRouteRegistry extends MRouteRegistry {
final home = MRouteItem<void, HomeScreen>.page(
category: 'main',
page: const HomeScreen(),
);
final profile = MRouteItem<ProfileArguments, ProfileScreen>(
category: 'main',
builder: (context, args) => ProfileScreen(args: args),
createArguments: (context) async {
// build and return MRouteGo(args) or null to cancel
return MRouteGo(ProfileArguments(userId: '1'));
},
);
@override
List<MRouteItem<dynamic, Widget>> get routes => [home, profile];
@override
List<MRouteEdge> get edges => [
MRouteEdge(home, profile),
];
}2. Open the map
final registry = AppRouteRegistry();
MapRouteScreen(registry: registry).view(context);3. Limit visible views (optional)
MapRouteScreen(
registry: registry,
views: [MViewType.graph],
)// one → many
MRouteEdge.edgesFrom(home, [profile, settings])
// many → one
MRouteEdge.edgesTo([auth, login], profileLoading)

