modular method
Use instead:
MaterialApp.router(
routeInformationParser: Modular.routeInformationParser,
routerDelegate: Modular.routerDelegate,
...
);
Implementation
@Deprecated('Use **MaterialApp.router** instead')
MaterialApp modular() {
Modular.setObservers(navigatorObservers ?? []);
Modular.setNavigatorKey(navigatorKey);
Modular.setInitialRoute(initialRoute ?? '/');
final app = MaterialApp.router(
key: key,
scaffoldMessengerKey: scaffoldMessengerKey,
routeInformationProvider: routeInformationProvider,
backButtonDispatcher: backButtonDispatcher,
builder: builder,
title: title,
onGenerateTitle: onGenerateTitle,
color: color,
theme: theme,
darkTheme: darkTheme,
highContrastTheme: highContrastTheme,
highContrastDarkTheme: highContrastDarkTheme,
themeMode: themeMode,
locale: locale,
localizationsDelegates: localizationsDelegates,
localeListResolutionCallback: localeListResolutionCallback,
localeResolutionCallback: localeResolutionCallback,
supportedLocales: supportedLocales,
debugShowMaterialGrid: debugShowMaterialGrid,
showPerformanceOverlay: showPerformanceOverlay,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showSemanticsDebugger: showSemanticsDebugger,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
shortcuts: shortcuts,
actions: actions,
restorationScopeId: restorationScopeId,
routeInformationParser: Modular.routeInformationParser,
routerDelegate: Modular.routerDelegate,
);
return app;
}