0 purchases
universal router
universal_router #
This package is a implementation of Navigator 2.0. Supported Router Table concept.
Features #
Easy to use.
Router table concept.
Various parameter setting.
Install #
Install by adding this package to your pubspec.yaml:
dependencies:
universal_router: ^[latest version]
copied to clipboard
Usage #
Import #
import 'package:universal_router/route.dart';
copied to clipboard
Simple Example #
import 'package:universal_router/route.dart';
void main() {
final universalRouter = UniversalRouter.initialize();
RouteInstance(
routePath: "",
title: "Home",
pageBuilder: (_, __) async => Home());
runApp(
MaterialApp.router(
routerDelegate: universalRouter.routerDelegate,
routeInformationProvider: universalRouter.routeInformationProvider,
routeInformationParser: universalRouter.routerInformationParser,
));
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) =>
TextButton(onPressed: () => {UniversalRouter.changePath("somewhere")},
child: Text('go to somewhere else'));
}
copied to clipboard
License #
Copyright © 2021, Jialin Li.
Released under the GNU AGPLv3.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.