createCupertinoWidget method

  1. @override
CupertinoApp createCupertinoWidget(
  1. BuildContext context
)
override

Implementation

@override
createCupertinoWidget(BuildContext context) {
  final dataRouter = cupertinoRouter?.call(context, platform(context));

  if (routeInformationParser != null ||
      dataRouter?.routeInformationParser != null ||
      routerConfig != null ||
      dataRouter?.routerConfig != null) {
    assert(dataRouter?.routerDelegate != null ||
        routerDelegate != null ||
        dataRouter?.routerConfig != null ||
        routerConfig != null);

    return CupertinoApp.router(
      routeInformationProvider:
          dataRouter?.routeInformationProvider ?? routeInformationProvider,
      routeInformationParser:
          dataRouter?.routeInformationParser ?? routeInformationParser,
      routerDelegate: dataRouter?.routerDelegate ?? routerDelegate,
      routerConfig: dataRouter?.routerConfig ?? routerConfig,
      backButtonDispatcher:
          dataRouter?.backButtonDispatcher ?? backButtonDispatcher,
      theme: dataRouter?.theme ?? _getCupertinoTheme(context),
      builder: dataRouter?.builder ?? builder,
      title: dataRouter?.title ?? title ?? '',
      onGenerateTitle: dataRouter?.onGenerateTitle ?? onGenerateTitle,
      color: dataRouter?.color ?? color,
      locale: dataRouter?.locale ?? locale,
      localizationsDelegates:
          dataRouter?.localizationsDelegates ?? localizationsDelegates,
      localeListResolutionCallback:
          dataRouter?.localeListResolutionCallback ??
              localeListResolutionCallback,
      localeResolutionCallback:
          dataRouter?.localeResolutionCallback ?? localeResolutionCallback,
      supportedLocales: dataRouter?.supportedLocales ??
          supportedLocales ??
          const <Locale>[Locale('en', 'US')],
      showPerformanceOverlay: dataRouter?.showPerformanceOverlay ??
          showPerformanceOverlay ??
          false,
      checkerboardRasterCacheImages:
          dataRouter?.checkerboardRasterCacheImages ??
              checkerboardRasterCacheImages ??
              false,
      checkerboardOffscreenLayers: dataRouter?.checkerboardOffscreenLayers ??
          checkerboardOffscreenLayers ??
          false,
      showSemanticsDebugger:
          dataRouter?.showSemanticsDebugger ?? showSemanticsDebugger ?? false,
      debugShowCheckedModeBanner: dataRouter?.debugShowCheckedModeBanner ??
          debugShowCheckedModeBanner ??
          true,
      shortcuts: dataRouter?.shortcuts ?? shortcuts,
      actions: dataRouter?.actions ?? actions,
      key: dataRouter?.widgetKey ?? widgetKey,
      restorationScopeId:
          dataRouter?.restorationScopeId ?? restorationScopeId,
      scrollBehavior: dataRouter?.scrollBehavior ?? scrollBehavior,
      onNavigationNotification:
          dataRouter?.onNavigationNotification ?? onNavigationNotification,
      // useInheritedMediaQuery: , Deprecated
    );
  } else {
    final data = cupertino?.call(context, platform(context));

    return CupertinoApp(
      key: data?.widgetKey ?? widgetKey,
      navigatorKey: data?.navigatorKey ?? navigatorKey,
      home: data?.home ?? home,
      routes: data?.routes ?? routes ?? const <String, WidgetBuilder>{},
      initialRoute: data?.initialRoute ?? initialRoute,
      onGenerateRoute: data?.onGenerateRoute ?? onGenerateRoute,
      onUnknownRoute: data?.onUnknownRoute ?? onUnknownRoute,
      navigatorObservers: data?.navigatorObservers ??
          navigatorObservers ??
          const <NavigatorObserver>[],
      builder: data?.builder ?? builder,
      title: data?.title ?? title ?? '',
      onGenerateTitle: data?.onGenerateTitle ?? onGenerateTitle,
      color: data?.color ?? color,
      locale: data?.locale ?? locale,
      localizationsDelegates:
          data?.localizationsDelegates ?? localizationsDelegates,
      localeListResolutionCallback:
          data?.localeListResolutionCallback ?? localeListResolutionCallback,
      localeResolutionCallback:
          data?.localeResolutionCallback ?? localeResolutionCallback,
      supportedLocales: data?.supportedLocales ??
          supportedLocales ??
          const <Locale>[Locale('en', 'US')],
      showPerformanceOverlay:
          data?.showPerformanceOverlay ?? showPerformanceOverlay ?? false,
      checkerboardRasterCacheImages: data?.checkerboardRasterCacheImages ??
          checkerboardRasterCacheImages ??
          false,
      checkerboardOffscreenLayers: data?.checkerboardOffscreenLayers ??
          checkerboardOffscreenLayers ??
          false,
      showSemanticsDebugger:
          data?.showSemanticsDebugger ?? showSemanticsDebugger ?? false,
      debugShowCheckedModeBanner: data?.debugShowCheckedModeBanner ??
          debugShowCheckedModeBanner ??
          true,
      theme: data?.theme ?? _getCupertinoTheme(context),
      shortcuts: data?.shortcuts ?? shortcuts,
      actions: data?.actions ?? actions,
      onGenerateInitialRoutes:
          data?.onGenerateInitialRoutes ?? onGenerateInitialRoutes,
      restorationScopeId: data?.restorationScopeId ?? restorationScopeId,
      scrollBehavior: data?.scrollBehavior ?? scrollBehavior,
      onNavigationNotification:
          data?.onNavigationNotification ?? onNavigationNotification,
      // useInheritedMediaQuery: , Deprecated
    );
  }
}