Application class final

The root of a Carpenter application.

Application provides Flutter's framework-level application services, Carpenter theme data, and the root unit scale without depending on Material or Cupertino. Use Application.router when routing is owned by a Router.

Inheritance

Constructors

Application({Key? key, CarpenterThemeData? theme, Px rem = const Px(16), GlobalKey<NavigatorState>? navigatorKey, RouteFactory? onGenerateRoute, InitialRouteListFactory? onGenerateInitialRoutes, RouteFactory? onUnknownRoute, NotificationListenerCallback<NavigationNotification>? onNavigationNotification, List<NavigatorObserver>? navigatorObservers = const <NavigatorObserver>[], String? initialRoute, PageRouteFactory? pageRouteBuilder, Widget? home, Map<String, WidgetBuilder>? routes = const <String, WidgetBuilder>{}, TransitionBuilder? builder, String? title, GenerateAppTitle? onGenerateTitle, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool showPerformanceOverlay = false, bool showSemanticsDebugger = false, bool debugShowWidgetInspector = false, bool debugShowCheckedModeBanner = false, ExitWidgetSelectionButtonBuilder? exitWidgetSelectionButtonBuilder, MoveExitWidgetSelectionButtonBuilder? moveExitWidgetSelectionButtonBuilder, TapBehaviorButtonBuilder? tapBehaviorButtonBuilder, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, String? restorationScopeId})
Creates an application backed by a Navigator.
const
Application.router({Key? key, CarpenterThemeData? theme, Px rem = const Px(16), RouteInformationProvider? routeInformationProvider, RouteInformationParser<Object>? routeInformationParser, RouterDelegate<Object>? routerDelegate, RouterConfig<Object>? routerConfig, BackButtonDispatcher? backButtonDispatcher, TransitionBuilder? builder, String? title, GenerateAppTitle? onGenerateTitle, NotificationListenerCallback<NavigationNotification>? onNavigationNotification, Locale? locale, Iterable<LocalizationsDelegate>? localizationsDelegates, LocaleListResolutionCallback? localeListResolutionCallback, LocaleResolutionCallback? localeResolutionCallback, Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')], bool showPerformanceOverlay = false, bool showSemanticsDebugger = false, bool debugShowWidgetInspector = false, bool debugShowCheckedModeBanner = false, ExitWidgetSelectionButtonBuilder? exitWidgetSelectionButtonBuilder, MoveExitWidgetSelectionButtonBuilder? moveExitWidgetSelectionButtonBuilder, TapBehaviorButtonBuilder? tapBehaviorButtonBuilder, Map<ShortcutActivator, Intent>? shortcuts, Map<Type, Action<Intent>>? actions, String? restorationScopeId})
Creates an application backed by a Router.
const

Properties

actions → Map<Type, Action<Intent>>?
Application-wide Flutter action mapping forwarded to the underlying WidgetsApp.
final
backButtonDispatcher → BackButtonDispatcher?
Back-button dispatcher forwarded to WidgetsApp.router.
final
builder → TransitionBuilder?
Optional application-level transition builder invoked inside CarpenterTheme. Use it to wrap the routed child without replacing Carpenter theme or unit scopes.
final
debugShowCheckedModeBanner → bool
Whether Flutter shows the checked-mode debug banner.
final
debugShowWidgetInspector → bool
Whether Flutter exposes the widget-inspector selection affordance in debug mode.
final
exitWidgetSelectionButtonBuilder → ExitWidgetSelectionButtonBuilder?
Optional builder for Flutter inspector UI used to exit widget-selection mode.
final
hashCode → int
The hash code for this object.
no setterinherited
home → Widget?
Default navigator-mode content when no named initial route replaces it.
final
initialRoute → String?
Initial named route for navigator mode. Router mode obtains its initial location from router configuration instead.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale → Locale?
Requested application locale. Flutter resolves it against supportedLocales and the configured resolution callbacks.
final
localeListResolutionCallback → LocaleListResolutionCallback?
Optional locale-list resolver forwarded to WidgetsApp.
final
localeResolutionCallback → LocaleResolutionCallback?
Optional single-locale resolver forwarded to WidgetsApp.
final
localizationsDelegates → Iterable<LocalizationsDelegate>?
Localization delegates forwarded to the underlying WidgetsApp.
final
moveExitWidgetSelectionButtonBuilder → MoveExitWidgetSelectionButtonBuilder?
Optional builder for the control that repositions Flutter inspector exit UI.
final
Navigator key used by the non-router application mode. It is ignored by Application.router.
final
Observers attached to the Navigator in non-router mode. Defaults to an empty list.
final
onGenerateInitialRoutes → InitialRouteListFactory?
Factory used by navigator mode to expand initialRoute into the initial route stack.
final
onGenerateRoute → RouteFactory?
Route factory forwarded to WidgetsApp in navigator mode when a named route is requested.
final
onGenerateTitle → GenerateAppTitle?
Locale-aware title generator forwarded to the underlying WidgetsApp; when present it takes precedence over a static title where Flutter applies it.
final
onNavigationNotification → NotificationListenerCallback<NavigationNotification>?
Optional listener for framework NavigationNotification events emitted by either navigator or router application mode.
final
onUnknownRoute → RouteFactory?
Fallback route factory used by navigator mode when onGenerateRoute and routes cannot resolve a name.
final
pageRouteBuilder → PageRouteFactory?
Factory used to turn a route builder into a PageRoute in navigator mode. Carpenter supplies a simple PageRouteBuilder when omitted.
final
rem → Px
The root size used to resolve Rem units.
final
restorationScopeId → String?
Restoration scope identifier forwarded to the underlying WidgetsApp.
final
routeInformationParser → RouteInformationParser<Object>?
Route-information parser used only by Application.router when a complete routerConfig is not supplied.
final
routeInformationProvider → RouteInformationProvider?
Route-information provider used only by Application.router.
final
routerConfig → RouterConfig<Object>?
Complete Flutter router configuration for Application.router. Do not combine it with separate provider/parser/delegate pieces unless Flutter explicitly supports that combination.
final
routerDelegate → RouterDelegate<Object>?
Router delegate used only by Application.router when a complete routerConfig is not supplied.
final
routes → Map<String, WidgetBuilder>?
Named route table forwarded to WidgetsApp in navigator mode. Defaults to an empty map.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shortcuts → Map<ShortcutActivator, Intent>?
Application-wide Flutter shortcut mapping forwarded to the underlying WidgetsApp. Carpenter command shortcuts can be layered below this root.
final
showPerformanceOverlay → bool
Whether Flutter draws its performance overlay above the application.
final
showSemanticsDebugger → bool
Whether Flutter draws the semantics debugger overlay.
final
supportedLocales → Iterable<Locale>
Locales supported by the application. Defaults to US English.
final
tapBehaviorButtonBuilder → TapBehaviorButtonBuilder?
Optional builder for Flutter inspector tap-behavior UI.
final
theme → CarpenterThemeData?
The semantic theme exposed to the application subtree.
final
title → String?
Static application title forwarded to the underlying WidgetsApp.
final

Methods

build(BuildContext context) → Widget
Builds either WidgetsApp or WidgetsApp.router, then installs the root UnitsRoot and CarpenterTheme around the framework-provided routed child.
override
createElement() → StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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, int wrapWidth = 65}) → 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