RtGetMaterialApp constructor
RtGetMaterialApp({
- Key? key,
- bool? enableDeepLink = false,
- dynamic handleDeepLink()?,
- 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,String, String> > - Translations? translations,
- VoidCallback? onInit,
- VoidCallback? onReady,
- VoidCallback? onDispose,
- ValueChanged<
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.
This constructor supports traditional route names and automatic deep link handling via platform message interception.
Parameters:
enableDeepLink: Enable deep link handling (must be true to activate)handleDeepLink: Callback to handle intercepted URIsnavigatorKey: Key for accessing navigator statehome: Initial widget to displayroutes: Map of route names to buildersinitialRoute: Starting route nameonGenerateRoute: Custom route factory- All other parameters inherited from GetMaterialApp
Example:
RtGetMaterialApp(
enableDeepLink: true,
handleDeepLink: (uri) {
if (uri.path == '/product') {
Get.toNamed('/product/${uri.queryParameters['id']}');
}
},
routes: {
'/': (context) => HomeScreen(),
'/product/:id': (context) => ProductScreen(),
},
);
Implementation
RtGetMaterialApp({
super.key,
this.enableDeepLink = false,
this.handleDeepLink,
this.navigatorKey,
super.scaffoldMessengerKey,
this.home,
Map<String, Widget Function(BuildContext)> this.routes =
const <String, WidgetBuilder>{},
this.initialRoute,
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
super.useInheritedMediaQuery = false,
super.navigatorObservers = const <NavigatorObserver>[],
super.builder,
super.textDirection,
super.title = '',
super.onGenerateTitle,
super.color,
super.theme,
super.darkTheme,
super.themeMode = ThemeMode.system,
super.locale,
super.fallbackLocale,
super.localizationsDelegates,
super.localeListResolutionCallback,
super.localeResolutionCallback,
super.supportedLocales = const <Locale>[Locale('en', 'US')],
super.debugShowMaterialGrid = false,
super.showPerformanceOverlay = false,
super.checkerboardRasterCacheImages = false,
super.checkerboardOffscreenLayers = false,
super.showSemanticsDebugger = false,
super.debugShowCheckedModeBanner = true,
super.shortcuts,
super.scrollBehavior,
super.customTransition,
super.translationsKeys,
super.translations,
super.onInit,
super.onReady,
super.onDispose,
super.routingCallback,
super.defaultTransition,
super.getPages,
super.opaqueRoute,
super.enableLog = kDebugMode,
super.logWriterCallback,
super.popGesture,
super.transitionDuration,
super.defaultGlobalState,
super.smartManagement = SmartManagement.full,
super.initialBinding,
super.unknownRoute,
super.highContrastTheme,
super.highContrastDarkTheme,
super.actions,
}) : routeInformationProvider = null,
routeInformationParser = null,
routerDelegate = null,
backButtonDispatcher = null {
// Initialize deep link listener if enabled and handler provided
(enableDeepLink != null && enableDeepLink! && handleDeepLink != null)
? initDeepLinkListener()
: "";
}