oobium_routing 1.0.0-dev.3 copy "oobium_routing: ^1.0.0-dev.3" to clipboard
oobium_routing: ^1.0.0-dev.3 copied to clipboard

discontinued
outdated

Simplified routing for Navigator 2.0. Type-safe, semi-declarative, supporting bidirectional browser address bar and nested routers.

oobium_routing #

pub package

Simplified routing for Flutter's Navigator 2.0.

  • type-safe
  • semi-declarative
  • browser address bar (bidi)
  • nested routers

Usage #

To use this plugin, add oobium_routing as a dependency in your pubspec.yaml file.

Example #

final routes = AppRoutes()
	..add<AuthorsRoute>(
		path: '/authors',
		onParse: (data) => AuthorsRoute(),
		onBuild: (ref) => [AuthorsPage()]
	)
	..add<BooksRoute>(
		path: '/books',
		onParse: (data) => BooksRoute(),
		onBuild: (ref) => [BooksPage()]
	);

void main() => runApp(MaterialApp.router(
    title: 'NavDemo',
    routeInformationParser: routes.createRouteParser(),
    routerDelegate: routes.createRouterDelegate()
));

class ExampleView extends StatelessWidget {

	Widget build(BuildContext context) {
		return Center(child: Row(children: [
			ElevatedButton(
				child: Text('Authors'),
				onPressed: () => context.route = AuthorsRoute(),
			),
			ElevatedButton(
				child: Text('Books'),
				onPressed: () => context.route = BooksRoute(),
			),
			ElevatedButton.icon(
				icon: Icon(Icons.arrow_back),
				label: Text('Back'),
				onPressed: () => Navigator.pop(context),
			),
		],),);
	}
}
1
likes
0
pub points
2%
popularity

Publisher

unverified uploader

Simplified routing for Navigator 2.0. Type-safe, semi-declarative, supporting bidirectional browser address bar and nested routers.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, flutter

More

Packages that depend on oobium_routing