UEMonitoredApp constructor
UEMonitoredApp({
- Key? key,
- GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, - Widget? home,
- Map<
String, WidgetBuilder> routes = const <String, WidgetBuilder>{}, - String? initialRoute,
- RouteFactory? onGenerateRoute,
- InitialRouteListFactory? onGenerateInitialRoutes,
- RouteFactory? onUnknownRoute,
- TransitionBuilder? builder,
- String? title = '',
- GenerateAppTitle? onGenerateTitle,
- Color? color,
- ThemeData? theme,
- ThemeData? darkTheme,
- ThemeData? highContrastTheme,
- ThemeData? highContrastDarkTheme,
- ThemeMode themeMode = ThemeMode.system,
- Duration themeAnimationDuration = kThemeAnimationDuration,
- Curve themeAnimationCurve = Curves.linear,
- 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, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- ScrollBehavior? scrollBehavior,
- bool useInheritedMediaQuery = false,
Creates a Monitored MaterialApp.
At least one of home, routes, onGenerateRoute, or builder must be
non-null. If only routes is given, it must include an entry for the
Navigator.defaultRouteName (/), since that is the route used when the
application is launched with an intent that specifies an otherwise
unsupported route.
This class creates an instance of WidgetsApp.
Implementation
UEMonitoredApp(
{super.key,
super.navigatorKey,
super.scaffoldMessengerKey,
super.home,
super.routes,
String? initialRoute,
RouteFactory? onGenerateRoute,
InitialRouteListFactory? onGenerateInitialRoutes,
RouteFactory? onUnknownRoute,
List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
super.builder,
super.title,
super.onGenerateTitle,
super.color,
super.theme,
super.darkTheme,
super.highContrastTheme,
super.highContrastDarkTheme,
ThemeMode super.themeMode,
super.themeAnimationDuration,
super.themeAnimationCurve,
super.locale,
super.localizationsDelegates,
super.localeListResolutionCallback,
super.localeResolutionCallback,
super.supportedLocales,
super.debugShowMaterialGrid,
super.showPerformanceOverlay,
super.checkerboardRasterCacheImages,
super.checkerboardOffscreenLayers,
super.showSemanticsDebugger,
super.debugShowCheckedModeBanner,
Map<LogicalKeySet, Intent>? super.shortcuts,
super.actions,
super.restorationScopeId,
super.scrollBehavior,
bool useInheritedMediaQuery = false})
: super(
initialRoute: () {
_onPreNavigation();
return initialRoute;
}(),
onGenerateRoute: (RouteSettings settings) {
// Pre-navigation action
_onPreNavigation();
// Call the developer's onGenerateRoute if provided
if (onGenerateRoute != null) {
return onGenerateRoute(settings);
}
// Default route handling
return null;
},
onGenerateInitialRoutes: onGenerateInitialRoutes != null
? (initialRoute) {
_onPreNavigation();
return onGenerateInitialRoutes(initialRoute);
}
: null,
onUnknownRoute: onUnknownRoute != null
? (RouteSettings settings) {
_onPreNavigation();
return onUnknownRoute(settings);
}
: null,
navigatorObservers: [
_UENavigationObserver(),
...navigatorObservers,
],
);