StandardAppRoutePluginMixin mixin
A mixin for enabling integration between the 'Patapata' Route system and Plugin, including routing and initialization processes. The method implemented in this mixin is called within the processing of StandardRouterDelegate.processInitialRoute when transitioning to the initial page after the app is launched.
In each plugin, please override and implement the following functions as needed. parseRouteInformation is responsible for parsing route information and implementing the process to convert it into StandardRouteData. This is implemented when you want to return custom routes on the plugin side. transformRouteInformation is used to implement the transformation process of route information in the plugin, primarily when you want to handle redirection. getInitialRouteData is used to implement the logic for overwriting the data of the Route before processing the initial route.
- Superclass constraints
- Mixin applications
Properties
-
app
→ App<
Object> -
The App referenced by the plugin.
no setterinherited
-
dependencies
→ List<
Type> -
The list of other plugins that this plugin depends on.
This property should be used to add the types of other plugins that are required for this Plugin to work.
For example, when using the FirebaseAnalyticsPlugin, you need to include FirebaseCorePlugin.
no setterinherited
- disposed → bool
-
Get whether this Plugin has been disposed.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized → bool
-
Whether this Plugin is initialized or not.
no setterinherited
-
methodCallLogs
→ List<
MethodCall> -
finalinherited
- name → String
-
The unique name of this Plugin.
This property is referenced in various situations, such as when enabling or disabling the plugin,
and when enabling or disabling the mock, and when communicating with Native code.
no setterinherited
-
Get the list of NavigatorObservers to pass to Patapata for this plugin.
This Observers list will ultimately be added to the App.navigatorObservers list.
no setterinherited
- remoteConfigEnabledKey → String
-
Get the RemoteConfig key name to enable or disable this plugin.
no setterinherited
- requireRemoteConfig → bool
-
This property determines whether initialization should occur after the RemoteConfig system has started when set to true,
or before it starts when set to false.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createAppWidgetWrapper(
Widget child) → Widget -
Wraps the Widget that will ultimately be passed to Flutter's runApp function.
This is used when the plugin needs to wrap App.createAppWidget to add widgets to the App's widget tree.
inherited
-
createLocalConfig(
) → LocalConfig? -
Specify the LocalConfig to register with Patapata for this plugin.
inherited
-
createRemoteConfig(
) → RemoteConfig? -
Specify the RemoteConfig to register with Patapata for this plugin.
inherited
-
createRemoteMessaging(
) → RemoteMessaging? -
Specify the RemoteMessaging to register with Patapata for this plugin.
inherited
-
dispose(
) → FutureOr< void> -
Disposes this Plugin.
Always call
super.dispose
before any other overridden code. In general you should not call this method as App will do that for you.inherited -
getInitialRouteData(
) → Future< StandardRouteData?> - The process of creating StandardRouteData to be passed from the plugin to the screen, and this data is passed to StandardRouterDelegate.routeWithConfiguration. If multiple plugins implement getInitialRouteData, the getInitialRouteData of the first found plugin will be executed.
-
init(
App< Object> app) → FutureOr<bool> -
Executed when a
PatapataApp
run
s or when a this Plugin is added to thePatapataApp
afterrun
. This may return a Future for asynchronous initialization. Always callsuper.init
before any other overridden code.inherited -
mockPatapataDisable(
) → void -
This is a function to mock patapataDisable running in native code.
It will only be called when kIsTest is true.
inherited
-
mockPatapataEnable(
) → void -
This is a function to mock patapataEnable running in native code.
It will only be called when kIsTest is true.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseRouteInformation(
RouteInformation routeInformation) → Future< StandardRouteData?> -
A function that parses the route information
routeInformation
and converts it to StandardRouteData for StandardRouterDelegate. If the plugin's parseRouteInformation is implemented and returns a route, the processing of transformRouteInformation is ignored. -
setMockMethodCallHandler(
) → void -
A function for mocking a MethodChannel.
inherited
-
setMockStreamHandler(
) → void -
A function for mocking a MockStreamHandler.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transformRouteInformation(
RouteInformation routeInformation) → Future< RouteInformation?> -
A function to transform the route information
routeInformation
into another transformed route information RouteInformation. This needs to be implemented when you want to redirect from one route to another based on the received route on the plugin side.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
inline(
{String name = 'inline', List< Type> dependencies = const <Type>[], bool requireRemoteConfig = false, FutureOr<bool> init(App<Object> app)?, FutureOr<void> dispose()?, Widget createAppWidgetWrapper(Widget child)?, RemoteConfig? createRemoteConfig()?, LocalConfig? createLocalConfig()?, RemoteMessaging? createRemoteMessaging()?, Future<StandardRouteData?> parseRouteInformation(RouteInformation routeInformation)?, Future<RouteInformation?> transformRouteInformation(RouteInformation routeInformation)?, Future<StandardRouteData?> getInitialRouteData()?}) → StandardAppRoutePluginMixin - Create a StandardAppRoutePluginMixin that can be used in App.addPlugin. This takes all the same parameters as Plugin.inline as well as all the methods of StandardAppRoutePluginMixin.