MasamuneApp class

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を指定することも可能です。

appRefkatana_scopedで使われているAppRefを渡すことができます。

themekatana_themeで使われているAppThemeDataを渡すことができます。また、themeModeThemeModeをあわせて指定できます。

localizekatana_localizeで利用されているAppLocalizeBaseを渡すことができます。

その他、modelAdapterauthAdapterといったデータや認証用のアダプターを渡すことが可能です。 また、masamuneAdaptersでMasamune Frameworkの追加プラグインアダプターを導入することが可能です。

routerConfigkatana_routerで使われているAppRouterを渡すことができます。

routerConfigを渡さなかった場合、通常のMaterialAppと同じ様にroutesinitialRouteonGenerateRouteonGenerateInitialRoutesonUnknownRoutebuildernavigatorObserversscaffoldMessengerKeyを用いてFlutterネイティブのルーティング機能を利用することも可能です。

また、homeを用いて単一のウィジェットを表示することができます。(Exampleなどで利用可能です)

titleonGenerateTitleでアプリタイトルを設定することが可能です。

debugShowCheckedModeBannerでデバッグ用のバナーを表示することができ、showPerformanceOverlayでパフォーマンスのオーバーレイを表示することができます。

Inheritance
Available Extensions
Annotations

Constructors

MasamuneApp({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>{}, List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[], GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey, String onGenerateTitle(BuildContext)?, 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.
const

Properties

appRef AppRef?
Ref for application scope called by katana_scoped.
final
authAdapter AuthAdapter?
Adapter for authentication used by katana_auth.
final
builder → (Widget Function(BuildContext context, Widget? child)?)
If routerConfig is not specified, a callback that is executed after the widget created by onGenerateRoute or other methods is generated.
final
debugShowCheckedModeBanner bool
If this is set to true, a banner is displayed in the upper right corner in debug mode.
final
functionsAdapter FunctionsAdapter?
Adapter for server processing used by katana_functions.
final
hashCode int
The hash code for this object.
no setterinherited
home Widget?
Specify the widget to be displayed first.
final
initialRoute String?
Specifies the initial route name when routes is used.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
localizationsDelegates List<LocalizationsDelegate>?
Define a list of LocalizationsDelegate.
final
localize AppLocalizeBase?
Data for localization used by katana_localize.
final
loggerAdapters List<LoggerAdapter>
Adapter for logging used by katana_logger.
final
masamuneAdapters List<MasamuneAdapter>
You can specify the plug-in adapter used by Masamune Framework.
final
modelAdapter ModelAdapter?
Adapter for database used by katana_model.
final
Observer to monitor navigation transitions.
final
onBuildAppFilters List<Widget Function(BuildContext context, Widget app)>?
It is executed when the application is built.
final
onGenerateInitialRoutes → (List<Route> Function(String routePath)?)
If routerConfig is not specified, this callback is executed when the first route is configured.
final
onGenerateRoute → (Route? Function(RouteSettings routeSettings)?)
If routerConfig is not specified, a callback that is executed when the route is generated.
final
onGenerateTitle → (String Function(BuildContext)?)
Specify the title of the application dynamically.
final
onUnknownRoute → (Route? Function(RouteSettings routeSettings)?)
If routerConfig is not specified, this callback is called when a route name not listed in routes is queried.
final
routerConfig RouterConfig<Object>?
Config for router used by katana_router.
final
routes Map<String, Widget Function(BuildContext)>
If routerConfig is not specified or home is specified, this is used to specify subsequent routing.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffoldMessengerKey GlobalKey<ScaffoldMessengerState>?
GlobalKey for storing ScaffoldMessengerState.
final
showPerformanceOverlay bool
If this is true, the performance status is displayed in an overlay.
final
storageAdapter StorageAdapter?
Adapter for file storage used by katana_storage.
final
supportedLocales List<Locale>?
You can specify a list of supported locales.
final
theme AppThemeData?
Theme data used by katana_theme.
final
themeMode ThemeMode?
Specify the theme mode for the application.
final
title String
Specify the title of the application.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

restartApp(BuildContext context, {FutureOr<void> onRestart()?}) Future<void>
Restart the application by passing context.