rubigo_router library

The public api of this package

Classes

RubigoBackGesture
Use a RubigoBackGesture to control if a screen may be popped with a back-gesture.
RubigoBusyService
This service is used to keep track if the application is busy. It is used by the RubigoRouter internally to track if the router is busy with navigating. You can also use this in your app to protect some lengthy processes against any user interaction. Calls to RubigoBusyService.busyWrapper may be nested.
RubigoBusyWidget
This widget protects its children from touch events by placing an IgnorePointer above them in a stack.
RubigoChangeInfo<SCREEN_ID extends Enum>
This class contains information about the navigation event. Used in RubigoControllerMixin.onTop and RubigoControllerMixin.willShow. With this information the controller can decide what to do next.
RubigoHolder
A minimalistic service locator for Objects. Although it does what it should, this class is only here to limit external dependencies in this package and samples.
RubigoMaterialApp<SCREEN_ID extends Enum>
A sample how to wire-up Flutter's MaterialApp.router with RubigoRouterDelegate, a RubigoRootBackButtonDispatcher and a RubigoBusyWidget.
RubigoRootBackButtonDispatcher
This class extends RootBackButtonDispatcher and delegates hardware back button presses to the RubigoRouter.ui.pop function or to RootBackButtonDispatcher.didPopRoute when appropriate.
RubigoRouter<SCREEN_ID extends Enum>
A router based on RubigoScreen's.
RubigoRouterDelegate<SCREEN_ID extends Enum>
Use this class to create a RubigoRouterDelegate or use it as a blue-print for your own RouterDelegate.
RubigoScreen<SCREEN_ID extends Enum>
A screen widget with a corresponding controller, which may implement a RubigoControllerMixin (but doesn't have to). This set is uniquely identified by a SCREEN_ID.
Ui<SCREEN_ID extends Enum>
This class groups ui navigation functions together. Use these navigation functions everywhere when the origin is user initiated, like on button presses. These calls will automatically be ignored if the app is busy.

Enums

EventType
All available navigation events. EventType.push, EventType.pop, EventType.popTo and EventType.replaceStack.

Mixins

RubigoControllerMixin<SCREEN_ID extends Enum>
Adds navigation events and easy access to the RubigoRouter to a controller.
RubigoScreenMixin<RUBIGO_CONTROLLER>
Adds easy access from a screen Widget to it's controller.

Extensions

ExtensionOnListOfRubigoScreens on ListOfRubigoScreens<SCREEN_ID>
A collection of extension methods on ListOfRubigoScreens
ExtensionOnListOfScreenId on List<SCREEN_ID>
A collection of extension methods on list of List<SCREEN_ID>.
ExtensionOnRubigoRouter on RubigoRouter<SCREEN_ID>
Extensions on RubigoRouter
ExtensionOnRubigoScreen on RubigoScreen<Enum>
Extensions on RubigoScreen

Functions

currentRouteIsPage(RubigoRouter<Enum> rubigoRouter) bool
Check if the current topmost route is a pageless route or a page(full)route.
rubigoBackButton(BuildContext context, RubigoRouter<Enum> rubigoRouter) Widget?
Use this function for AppBar.leading to show a standard BackButton that delegates onPressed to the RubigoRouter.ui.pop function.

Typedefs

ListOfRubigoScreens<SCREEN_ID extends Enum> = List<RubigoScreen<SCREEN_ID>>
A list of RubigoScreen.
LogNavigation = Future<void> Function(String message)
A function to log navigation events, using your favorite logger
PostNavigationCallback = Future<void> Function()
A function to execute, when the current navigation finishes.