mosaique library
A declarative, route-driven region-based view composition package for Flutter.
Mosaique allows you to define shell layouts with named regions that can be filled with different views based on navigation. It integrates seamlessly with go_router.
Example
final router = GoRouter(
routes: [
MosaiqueShellRoute(
shellBuilder: (context) => const MainShell(),
regions: const ['header', 'menu', 'content'],
fixedRegions: {
'header': (context) => const HeaderView(),
'menu': (context) => const MainMenuView(),
},
routes: [
MosaiqueViewRoute(
path: 'dashboard',
region: 'content',
builder: (context, state) => const DashboardView(),
),
],
),
],
);
Classes
- MosaiqueShellRoute
- A route that defines a shell layout with named regions.
- MosaiqueViewRoute
- A route that injects a view widget into a specific region of the parent shell.
- Region
- A placeholder widget that gets replaced with actual content based on the current route.