beamer
1.7.0, released 2 years ago by beamer.dev
A routing package built on top of Router and Navigator's pages API, supporting arbitrary nested navigation.
What it does
Beamer splits navigation responsibilities into multiple BeamLocation classes that manage stacks of pages. It integrates with Flutter's Router API to handle deep linking, nested navigation, guards, and browser history synchronization.
AI-written summary of version 1.7.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need complex, nested routing structures in a Flutter application
- You want declarative navigation based on page stacks and URL paths
Skip it when
- You prefer simple imperative navigation like standard Navigator push and pop
- You want a zero-configuration routing setup without defining location builders or route maps
Strengths
- Supports arbitrary nested navigation and multiple beamers
- Handles deep linking and browser history out of the box
- Allows modular organization of page stacks via BeamLocation
Weaknesses
- Steeper learning curve compared to imperative navigation or simpler routers
- Requires understanding of Router and Navigator 2.0 concepts
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Requires setting up MaterialApp.router with BeamerDelegate, RouteInformationParser, and BeamerBackButtonDispatcher.
class MyApp extends StatelessWidget {
final routerDelegate = BeamerDelegate(
locationBuilder: RoutesLocationBuilder(
routes: {
'/': (context, state, data) => HomeScreen(),
'/books': (context, state, data) => BooksScreen(),
},
),
);
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routeInformationParser: BeamerParser(),
routerDelegate: routerDelegate,
);
}
}Alternatives
Packages that do the same job and could replace beamer.
- go_router
Provides a more declarative URL-based routing API officially recommended by the Flutter team.
98Compare - auto_route
Offers code-generation-based strongly-typed routing and deep-linking support.
87Compare