RtGetMaterialApp constructor

RtGetMaterialApp({
  1. Key? key,
  2. bool? enableDeepLink = false,
  3. dynamic handleDeepLink(
    1. Uri
    )?,
  4. GlobalKey<NavigatorState>? navigatorKey,
  5. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  6. Widget? home,
  7. Map<String, Widget Function(BuildContext)> routes = const <String, WidgetBuilder>{},
  8. String? initialRoute,
  9. RouteFactory? onGenerateRoute,
  10. InitialRouteListFactory? onGenerateInitialRoutes,
  11. RouteFactory? onUnknownRoute,
  12. bool useInheritedMediaQuery = false,
  13. List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  14. TransitionBuilder? builder,
  15. TextDirection? textDirection,
  16. String title = '',
  17. GenerateAppTitle? onGenerateTitle,
  18. Color? color,
  19. ThemeData? theme,
  20. ThemeData? darkTheme,
  21. ThemeMode themeMode = ThemeMode.system,
  22. Locale? locale,
  23. Locale? fallbackLocale,
  24. Iterable<LocalizationsDelegate>? localizationsDelegates,
  25. LocaleListResolutionCallback? localeListResolutionCallback,
  26. LocaleResolutionCallback? localeResolutionCallback,
  27. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  28. bool debugShowMaterialGrid = false,
  29. bool showPerformanceOverlay = false,
  30. bool checkerboardRasterCacheImages = false,
  31. bool checkerboardOffscreenLayers = false,
  32. bool showSemanticsDebugger = false,
  33. bool debugShowCheckedModeBanner = true,
  34. Map<LogicalKeySet, Intent>? shortcuts,
  35. ScrollBehavior? scrollBehavior,
  36. CustomTransition? customTransition,
  37. Map<String, Map<String, String>>? translationsKeys,
  38. Translations? translations,
  39. VoidCallback? onInit,
  40. VoidCallback? onReady,
  41. VoidCallback? onDispose,
  42. ValueChanged<Routing?>? routingCallback,
  43. Transition? defaultTransition,
  44. List<GetPage>? getPages,
  45. bool? opaqueRoute,
  46. bool? enableLog = kDebugMode,
  47. LogWriterCallback? logWriterCallback,
  48. bool? popGesture,
  49. Duration? transitionDuration,
  50. bool? defaultGlobalState,
  51. SmartManagement smartManagement = SmartManagement.full,
  52. Bindings? initialBinding,
  53. GetPage? unknownRoute,
  54. ThemeData? highContrastTheme,
  55. ThemeData? highContrastDarkTheme,
  56. Map<Type, Action<Intent>>? actions,
})

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 URIs
  • navigatorKey: Key for accessing navigator state
  • home: Initial widget to display
  • routes: Map of route names to builders
  • initialRoute: Starting route name
  • onGenerateRoute: 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()
      : "";
}