p_router 0.0.1 icon indicating copy to clipboard operation
p_router: ^0.0.1 copied to clipboard

p_router utils

router #

router utils

Setup #

定义路由 Map: p_router/router_config.dart

Map<String, WidgetBuilder> route = {
  HomePage.routeName: (_) => HomePage(),
  MainPage.routeName: (_) => MainPage(),
  MinePage.routeName: (_) => MinePage(),
};

在 MaterialApp 中设置 navigatorKey

MaterialApp(
    navigatorKey: RouterUtils.navigatorKey,
    routes: route,
    home: Builder(
        builder: (context) {
            return SplashPage();
        },
    ),
    ...
}
0
likes
100
pub points
0%
popularity

Publisher

unverified uploader

p_router utils

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on p_router