interceptorScreen method

Widget interceptorScreen({
  1. bool isDarkTheme = true,
  2. bool wrapInMaterialApp = false,
})

Provides the main widget for the interceptor screen.

On desktop multi-view windows this is a page widget (the entry shell is provided by multiview_desktop). On mobile / in-route navigation it is wrapped in a MaterialApp.

  • isDarkTheme: Whether to use dark theme. Defaults to true.
  • wrapInMaterialApp: When true, wraps content in MaterialApp.

Implementation

Widget interceptorScreen({
  bool isDarkTheme = true,
  bool wrapInMaterialApp = false,
}) {
  final ThemeData themeData =
      isDarkTheme ? InfospectTheme.darkTheme : InfospectTheme.lightTheme;
  mobileRoutes.themeData = themeData;

  _ensureNotifiers();

  final Widget home = mobileRoutes.launch(
    Infospect.instance,
    networksListNotifier: _networksListNotifier!,
    logsListNotifier: _logsListNotifier!,
  );

  if (!wrapInMaterialApp) {
    return home;
  }

  return MaterialApp(
    debugShowCheckedModeBanner: false,
    localizationsDelegates: const <LocalizationsDelegate<Object>>[],
    supportedLocales: const <Locale>[
      Locale('en', 'US'),
    ],
    theme: themeData,
    home: home,
  );
}