RtGetMaterialApp class
Extended GetMaterialApp with built-in deep linking support.
Extends GetMaterialApp to provide seamless deep link handling for both named routes and router-based navigation. Automatically intercepts platform navigation messages and delegates them to a custom handler.
Features:
- Deep link interception via platform message channel
- Support for both standard and router-based navigation
- Automatic URI parsing from platform navigation events
- Error handling with user feedback via snackbar
- Full compatibility with GetX routing system
Example (standard navigation):
RtGetMaterialApp(
enableDeepLink: true,
handleDeepLink: (uri) {
// Handle deep link navigation
if (uri.pathSegments.first == 'details') {
Get.toNamed('/details/${uri.pathSegments[1]}');
}
},
initialRoute: '/',
getPages: [
GetPage(name: '/', page: () => HomePage()),
GetPage(name: '/details/:id', page: () => DetailsPage()),
],
);
Example (router-based navigation):
RtGetMaterialApp.router(
true, // enableDeepLink
(uri) => handleMyDeepLink(uri), // handler
routerDelegate: myRouterDelegate,
routeInformationParser: myRouteParser,
);
See also:
- RtDeepLinking for singleton-based deep link service
- GetMaterialApp for base routing functionality
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- GetMaterialApp
- RtGetMaterialApp
- Available extensions
Constructors
-
RtGetMaterialApp({Key? key, bool? enableDeepLink = false, dynamic handleDeepLink(Uri)?, GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, Widget? home, Map<String, Widget Function(BuildContext)> routes = const <String, WidgetBuilder>{}, String? initialRoute, RouteFactory? onGenerateRoute, InitialRouteListFactory? onGenerateInitialRoutes, RouteFactory? onUnknownRoute, bool useInheritedMediaQuery = false, TransitionBuilder? builder, TextDirection? textDirection, String title = '', GenerateAppTitle? onGenerateTitle, Color? color, ThemeData? theme, ThemeData? darkTheme, ThemeMode themeMode = ThemeMode.system, Locale? locale, Locale? fallbackLocale, Iterable<LocalizationsDelegate> ? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<LogicalKeySet, Intent> ? shortcuts, ScrollBehavior? scrollBehavior, CustomTransition? customTransition, Map<String, Map< ? translationsKeys, Translations? translations, VoidCallback? onInit, VoidCallback? onReady, VoidCallback? onDispose, ValueChanged<String, String> >Routing?> ? routingCallback, Transition? defaultTransition, List<GetPage> ? getPages, bool? opaqueRoute, bool? enableLog = kDebugMode, LogWriterCallback? logWriterCallback, bool? popGesture, Duration? transitionDuration, bool? defaultGlobalState, SmartManagement smartManagement = SmartManagement.full, Bindings? initialBinding, GetPage? unknownRoute, ThemeData? highContrastTheme, ThemeData? highContrastDarkTheme, Map<Type, Action< ? actions})Intent> > - Creates an RtGetMaterialApp with standard named route navigation.
-
RtGetMaterialApp.router(bool? enableDeepLink, dynamic handleDeepLink(Uri)?, {Key? key, RouteInformationProvider? routeInformationProvider, GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, RouteInformationParser<Object> ? routeInformationParser, RouterDelegate<Object> ? routerDelegate, BackButtonDispatcher? backButtonDispatcher, TransitionBuilder? builder, String title = '', GenerateAppTitle? onGenerateTitle, Color? color, ThemeData? theme, ThemeData? darkTheme, bool useInheritedMediaQuery = false, ThemeData? highContrastTheme, ThemeData? highContrastDarkTheme, ThemeMode themeMode = ThemeMode.system, Locale? locale, Iterable<LocalizationsDelegate> ? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool debugShowMaterialGrid = false, bool showPerformanceOverlay = false, bool checkerboardRasterCacheImages = false, bool checkerboardOffscreenLayers = false, bool showSemanticsDebugger = false, bool debugShowCheckedModeBanner = true, Map<LogicalKeySet, Intent> ? shortcuts, ScrollBehavior? scrollBehavior, Map<Type, Action< ? actions, CustomTransition? customTransition, Map<Intent> >String, Map< ? translationsKeys, Translations? translations, TextDirection? textDirection, Locale? fallbackLocale, ValueChanged<String, String> >Routing?> ? routingCallback, Transition? defaultTransition, bool? opaqueRoute, VoidCallback? onInit, VoidCallback? onReady, VoidCallback? onDispose, bool? enableLog = kDebugMode, LogWriterCallback? logWriterCallback, bool? popGesture, SmartManagement smartManagement = SmartManagement.full, Bindings? initialBinding, Duration? transitionDuration, bool? defaultGlobalState, List<GetPage> ? getPages, GetPage? unknownRoute}) - Creates an RtGetMaterialApp with router-based navigation.
Properties
-
actions
→ Map<
Type, Action< ?Intent> > -
finalinherited
- backButtonDispatcher → BackButtonDispatcher?
-
Handles back button behavior in router-based navigation.
final
- builder → TransitionBuilder?
-
finalinherited
- checkerboardOffscreenLayers → bool
-
finalinherited
- checkerboardRasterCacheImages → bool
-
finalinherited
- color → Color?
-
finalinherited
- customTransition → CustomTransition?
-
finalinherited
- darkTheme → ThemeData?
-
finalinherited
- debugShowCheckedModeBanner → bool
-
finalinherited
- debugShowMaterialGrid → bool
-
finalinherited
- defaultGlobalState → bool?
-
finalinherited
- defaultTransition → Transition?
-
finalinherited
- enableDeepLink → bool?
-
Enable/disable deep link handling (default: false).
final
- enableLog → bool?
-
finalinherited
- fallbackLocale → Locale?
-
finalinherited
-
getPages
→ List<
GetPage> ? -
finalinherited
- handleDeepLink → dynamic Function(Uri)?
-
Callback invoked when a deep link is intercepted.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highContrastDarkTheme → ThemeData?
-
finalinherited
- highContrastTheme → ThemeData?
-
finalinherited
- home → Widget?
-
Home widget displayed when app launches.
final
- initialBinding → Bindings?
-
finalinherited
- initialRoute → String?
-
Initial route name when app launches.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- locale → Locale?
-
finalinherited
- localeListResolutionCallback → LocaleListResolutionCallback?
-
finalinherited
- localeResolutionCallback → LocaleResolutionCallback?
-
finalinherited
-
localizationsDelegates
→ Iterable<
LocalizationsDelegate> ? -
finalinherited
- logWriterCallback → LogWriterCallback?
-
finalinherited
- marginZero → Widget
-
Available on Widget, provided by the WidgetMarginX extension
no setter -
Global key for accessing navigator state.
final
-
finalinherited
- onDispose → VoidCallback?
-
finalinherited
- onGenerateInitialRoutes → InitialRouteListFactory?
-
Factory for generating initial route list.
final
- onGenerateRoute → RouteFactory?
-
Factory for generating routes dynamically.
final
- onGenerateTitle → GenerateAppTitle?
-
finalinherited
- onInit → VoidCallback?
-
finalinherited
- onReady → VoidCallback?
-
finalinherited
- onUnknownRoute → RouteFactory?
-
Factory for handling unknown routes.
final
- opaqueRoute → bool?
-
finalinherited
- paddingZero → Widget
-
Available on Widget, provided by the WidgetPaddingX extension
no setter - popGesture → bool?
-
finalinherited
-
routeInformationParser
→ RouteInformationParser<
Object> ? -
Parser for converting route information to typed objects.
final
- routeInformationProvider → RouteInformationProvider?
-
Route information provider for router-based navigation.
final
-
routerDelegate
→ RouterDelegate<
Object> ? -
Delegate that builds the navigator widget.
final
-
routes
→ Map<
String, WidgetBuilder> ? -
Map of route names to widget builders.
final
-
routingCallback
→ ValueChanged<
Routing?> ? -
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
scaffoldMessengerKey
→ GlobalKey<
ScaffoldMessengerState> ? -
finalinherited
- scrollBehavior → ScrollBehavior?
-
finalinherited
-
shortcuts
→ Map<
LogicalKeySet, Intent> ? -
finalinherited
- showPerformanceOverlay → bool
-
finalinherited
- showSemanticsDebugger → bool
-
finalinherited
- sliverBox → Widget
-
Available on Widget, provided by the WidgetSliverBoxX extension
no setter - smartManagement → SmartManagement
-
finalinherited
-
supportedLocales
→ Iterable<
Locale> -
finalinherited
- textDirection → TextDirection?
-
finalinherited
- theme → ThemeData?
-
finalinherited
- themeMode → ThemeMode
-
finalinherited
- title → String
-
finalinherited
- transitionDuration → Duration?
-
finalinherited
- translations → Translations?
-
finalinherited
-
translationsKeys
→ Map<
String, Map< ?String, String> > -
finalinherited
- unknownRoute → GetPage?
-
finalinherited
- useInheritedMediaQuery → bool
-
finalinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
defaultBuilder(
BuildContext context, Widget? child) → Widget -
inherited
-
generator(
RouteSettings settings) → Route -
inherited
-
initDeepLinkListener(
) → void - Initializes deep link listener on platform message channel.
-
initialRoutesGenerate(
String name) → List< Route> -
inherited
-
marginAll(
double margin) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
marginOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
marginSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paddingAll(
double padding) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
paddingOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
paddingSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited