Flutter self made plug-in R_ Router does not need context routing plug-in


Flutter self made plug-in R_ Router does not need context routing plug-in


A fluent routing plug-in that does not require context navigation and supports dialog


|GitHub address:

| https://github.com/rhymelph/r…

|Pub address:

| https://pub.dev/packages/r_ro…


1. Start using

  • pubspec.yamlFile add dependency
  r_router: last version
  • Import package
import 'package:r_router/r_router.dart';

2. Simple use

  • Register routing
///[path] your routing path
///[routerwidgetbuilder] build your page
///[params] your parameter supports all types of values. The type is dynamic
///[PAGEONE] your part
    path: '/one',
    routerWidgetBuilder: (params) => PageOne(title:params["title"]),
  • Add your route to app
class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      // add new
      onGenerateRoute: RRouter.myRouter.routerGenerate,
      navigatorObservers: [
      // add new
      home: MyHomePage(title: 'Flutter Demo Home Page'),
  • Navigate to the registered page
    RRouter.myRouter.navigateTo('/one', arguments: {'title': 'hello world!'});

3. Register routing

///Register route not found for page
RRouter.myRouter.notFoundPage = (String path) => NoFoundPage(
        path: path,

///Register the route with transition animation. The default is the transition animation according to the corresponding platform, IOS: cupertinopageroute, Android: materialpageroute
      path: '/three',
      routerWidgetBuilder: (params) => PageThree(),
      routerPageBuilder: (RouteSettings setting, WidgetBuilder builder) =>
          CupertinoPageRoute(builder: builder, settings: setting))

4. Display dialog box method without context

The following methods are supported

  • showRDialog
  • showRCupertinoDialog
  • showRCupertinoModalPopup
  • showRAboutDialog
  • showRMenu
  • showRTimePicker
  • showRGeneralDialog
  • showRDatePicker
  • showRSearch
  • showRModalBottomSheet
  • showRLicensePage

5. Default router

You can use the following code for route jump