MasamuneApp constructor
- Key? key,
- AppRef? appRef,
- AuthAdapter? authAdapter,
- StorageAdapter? storageAdapter,
- FunctionsAdapter? functionsAdapter,
- List<
LoggerAdapter> loggerAdapters = const [], - AppThemeData? theme,
- AppLocalizeBase? localize,
- RouterConfig<
Object> ? routerConfig, - ModelAdapter? modelAdapter = const RuntimeModelAdapter(),
- bool debugShowCheckedModeBanner = true,
- bool showPerformanceOverlay = false,
- String title = "",
- ThemeMode? themeMode = ThemeMode.system,
- Map<
String, Widget Function(BuildContext)> routes = const <String, WidgetBuilder>{}, - GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, - String onGenerateTitle()?,
- Widget? home,
- String? initialRoute,
- Route? onGenerateRoute(
- RouteSettings routeSettings
- List<
Route> onGenerateInitialRoutes(- String routePath
- Route? onUnknownRoute(
- RouteSettings routeSettings
- Widget builder(
- BuildContext context,
- Widget? child
- List<
Widget Function(BuildContext context, Widget app)> ? onBuildAppFilters, - List<
MasamuneAdapter> masamuneAdapters = const <MasamuneAdapter>[], - List<
LocalizationsDelegate> ? localizationsDelegates, - List<
Locale> ? supportedLocales,
MaterialApp for Masamune Framework.
It encapsulates the XXScope widget used in a series of katana packages. In addition, XXXScope can be specified by adding onBuildAppFilters.
You can pass the AppRef used in katana_scoped
in appRef.
You can pass AppThemeData used in katana_theme
in theme. You can also specify ThemeMode in themeMode.
You can pass AppLocalizeBase used by katana_localize
in localize.
Other adapters for data and authentication such as modelAdapter and authAdapter can be passed.
It is also possible to install additional plug-in adapters for the Masamune Framework in masamuneAdapters.
You can pass the AppRouter used by katana_router
in routerConfig.
If you do not pass routerConfig, you can also use Flutter"s native routing functionality as you normally would with MaterialApp, using routes, initialRoute, onGenerateRoute, onGenerateInitialRoutes, onUnknownRoute , builder, navigatorObservers, and scaffoldMessengerKey to take advantage of Flutter"s native routing capabilities.
You can also use home to display a single widget. (available in Example, for example).
The application title can be set with title and onGenerateTitle.
The debug banner can be displayed with debugShowCheckedModeBanner and the performance overlay can be displayed with showPerformanceOverlay.
Masamune Framework用のMaterialApp。
一連のkatanaのパッケージで利用されているXXScopeのウィジェットを内包しています。さらにonBuildAppFiltersを追加することでXXXScopeを指定することも可能です。
appRefでkatana_scoped
で使われているAppRefを渡すことができます。
themeでkatana_theme
で使われているAppThemeDataを渡すことができます。また、themeModeでThemeModeをあわせて指定できます。
localizeでkatana_localize
で利用されているAppLocalizeBaseを渡すことができます。
その他、modelAdapterやauthAdapterといったデータや認証用のアダプターを渡すことが可能です。 また、masamuneAdaptersでMasamune Frameworkの追加プラグインアダプターを導入することが可能です。
routerConfigでkatana_router
で使われているAppRouterを渡すことができます。
routerConfigを渡さなかった場合、通常のMaterialAppと同じ様にroutesやinitialRoute、onGenerateRoute、onGenerateInitialRoutes、onUnknownRoute、builder、navigatorObservers、scaffoldMessengerKeyを用いてFlutterネイティブのルーティング機能を利用することも可能です。
また、homeを用いて単一のウィジェットを表示することができます。(Exampleなどで利用可能です)
title、onGenerateTitleでアプリタイトルを設定することが可能です。
debugShowCheckedModeBannerでデバッグ用のバナーを表示することができ、showPerformanceOverlayでパフォーマンスのオーバーレイを表示することができます。
Implementation
const MasamuneApp({
super.key,
this.appRef,
this.authAdapter,
this.storageAdapter,
this.functionsAdapter,
this.loggerAdapters = const [],
this.theme,
this.localize,
this.routerConfig,
this.modelAdapter = const RuntimeModelAdapter(),
this.debugShowCheckedModeBanner = true,
this.showPerformanceOverlay = false,
this.title = "",
this.themeMode = ThemeMode.system,
this.routes = const <String, WidgetBuilder>{},
this.navigatorObservers = const <NavigatorObserver>[],
this.scaffoldMessengerKey,
this.onGenerateTitle,
this.home,
this.initialRoute,
this.onGenerateRoute,
this.onGenerateInitialRoutes,
this.onUnknownRoute,
this.builder,
this.onBuildAppFilters,
this.masamuneAdapters = const <MasamuneAdapter>[],
this.localizationsDelegates,
this.supportedLocales,
});