FleuryApp
The app-scale shell: it installs the app’s theme, its commands with
their keyboard shortcuts, a StatusController for status items, typed
extensions, focus traversal, and the app’s semantic node, labeled
title; then it shows home in a root Navigator, or your own child
shell.
Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.
FleuryApp( title: 'Inbox', commands: [ AppCommand( id: const CommandId('inbox.archive'), title: 'Archive message', shortcuts: [KeySequence.a], enabled: (_) => unread > 0, run: (_) => setState(() => unread -= 1), ), ], status: (app) => [StatusItem.text('Unread', value: '$unread')], home: const InboxScreen(),)Details
Section titled “Details”Pass home for the standard app shell. Fleury installs a root Navigator
below every app-owned scope, so all pushed routes retain the same theme,
commands, status, extensions, and data sources.
Pass child instead when the app owns a custom shell, including its own
navigation. Exactly one of home and child must be provided.
Descendants reach the app through FleuryApp.of, which returns its
FleuryAppController.
Constructors
Section titled “Constructors”FleuryApp()
Section titled “FleuryApp()”| Parameter | Type | Default | Description |
|---|---|---|---|
title: | String | required | The app’s name, used as the label of the app’s semantic node (SemanticRole.app), which is how agents and tests identify the app. It isn’t shown in the app’s UI, and it doesn’t set the terminal’s window or tab title. More |
commands: | List<AppCommand> | const <AppCommand>[] | App-wide commands: named actions that shortcuts, command palettes, agents, and tests can run on any screen. More |
extensions: | List<Object> | const <Object>[] | App-owned objects that descendants and commands look up by type, such as a workspace or a service client: FleuryApp.extension in a widget, FleuryCommandContext.appExtension in a command. The first entry assignable to the requested type wins. More |
status: | AppStatusBuilder? | — | Builds the status items the app derives from its own state, such as the current branch or a connection’s health. An AppStatusBar placed in the app displays them; FleuryApp draws none itself. More |
theme: | ThemeData? | — | App-wide theme installed above the standard or custom shell. More |
home: | Widget? | — | Initial route for Fleury’s standard root Navigator. |
child: | Widget? | — | Explicit custom shell escape hatch. More |
-
title:setTerminalTitlesets the window title. Code can read the name asFleuryAppController.title; rebuilding with a new title updates both. -
commands: Each command’sAppCommand.shortcutsare bound at the app root and run it only while it is visible and enabled; otherwise the key passes on. While a presented dialog is on top, keys it doesn’t handle stop at the dialog, so app shortcuts wait until it closes. Each visible command also appears as acommandnode under the app’s semantic node, which an agent or test can activate. A shortcut or semantic activation runs the command withCommandContext.buildContextset to the focused widget’s context when focus is inside the app, else to the active route’s when there is one.Ids must be unique within the list; a duplicate throws an
ArgumentError. Commands contributed byFleuryAppExtensions follow these, and one with the same id as a command here is dropped. ACommandScopeadds screen-level commands. A lookup by id from inside it, as a registry-backed command palette orCommandRegistry.commandmakes, finds the scope’s command before an app command with the same id. The app’s own shortcut and semantic node still run the app’s command; a scope command bound to the same shortcut takes the key first, as a deeper binding does. Rebuilding with a new list replaces the commands. -
extensions: An entry that extendsFleuryAppExtensionalso contributes to the app: commands (aftercommands, which win on a matching id), status items (after thosestatusbuilds), theme extensions (after the theme’s own, which win on a matching type), and data sources forFleuryApp.dataSource. Fleury only looks these objects up; it never creates, disposes, or refreshes them. Rebuilding with a new list updates the running app in place. -
status: Items fromFleuryAppExtensions follow these. Fleury calls the builder when the app starts, whenever its parent rebuilds it, and after each command run through the app’sCommandRegistry, not when the state it reads changes. Report state that changes on its own, such as a task’s progress, withStatusController.putonFleuryApp.of(context).status; an item put there replaces the built item with the same id. -
theme: When omitted, Fleury preserves the ambient theme. Theme extensions contributed throughextensionsare appended as package defaults; entries in this theme (or the ambient theme) win on matching types. -
child: Fleury does not install aNavigatoraround this widget. Use this when the app supplies its own navigation or intentionally has none. A custom shell that needs global root navigation should expose one top-levelNavigatorand place any pane-local navigators beneath it; sibling root navigators have no unambiguous app-wide target.
Source
Section titled “Source”FleuryApp is defined in packages/fleury/lib/src/app/app.dart.
Category: App & theming · All widgets