App class final

Root DSL builder.

App is the agent-facing composition surface exported through flash.dart. It records declarations first and compiles them later, so duplicate names and invalid relationships fail deterministically before push.

Available extensions

Constructors

App()

Methods

actionBlock(String name, {Map<String, DslType>? params, DslType? returns, Object? actions, String description = ''}) ActionBlockHandle
Declares an app-level action block.
apiGroup(String name, {required String baseUrl, Map<String, String>? headers, List<Endpoint>? endpoints}) ApiGroupDeclaration
Declares an API group and attaches the supplied endpoints to it.
bottomNav({required Iterable<BottomNavItem> items, BottomNavStyle style = BottomNavStyle.flutter, ColorToken? backgroundColor, ColorToken? selectedColor, ColorToken? unselectedColor}) → void
Declares a project-wide bottom navigation shell.
breakpoints({double? small, double? medium, double? large}) → void
Sets responsive breakpoints (in logical pixels).
collection(String name, {required Map<String, DslType> fields, String? description}) FirestoreCollectionHandle
Declares one Firestore collection handle for CRUD/query actions.
component(String name, {String? description, Map<String, DslType>? params, required DslWidget body}) → dynamic
Declares a reusable component and returns a callable handle for it.
constant(String name, Object? value, {String? description}) → void
Declares one named constant.
customFunction(String name, {Map<String, DslType>? args, required DslType returns, required String code, String description = ''}) CustomFunctionHandle
Declares an app-level custom function.
darkMode({bool enabled = true}) → void
Enables or disables dark mode.
editComponent(String name, void build(BrownfieldWidgetEditor component)) → void

Available on App, provided by the BrownfieldPageEditing extension

Queues rerunnable structural edits against an existing component.
editComponentParams(String name, void build(BrownfieldParamEditor params)) → void

Available on App, provided by the BrownfieldParamEditing extension

Ensures parameters exist on an existing component without recreating it.
editComponentState(String name, void build(BrownfieldStateEditor state)) → void

Available on App, provided by the BrownfieldStateEditing extension

Ensures component-local state fields exist on an existing component.
editPage(String name, void build(BrownfieldWidgetEditor component)) → void

Available on App, provided by the BrownfieldPageEditing extension

Queues rerunnable structural edits against an existing page.
editPageParams(String name, void build(BrownfieldParamEditor params)) → void

Available on App, provided by the BrownfieldParamEditing extension

Ensures parameters exist on an existing page without recreating it.
editPageState(String name, void build(BrownfieldStateEditor state)) → void

Available on App, provided by the BrownfieldStateEditing extension

Ensures page-local state fields exist on an existing page.
ensureAppBarActions({required String page, required List<DslWidget> actions}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Ensures one or more action widgets exist in the page app bar.
ensureButtonBindings({required String page, required BrownfieldPatternTarget button, Object? text, Object? visibleWhen}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Binds an existing button's text and/or visibility to expressions.
ensureCrudFormSubmit({required String page, required BrownfieldPatternTarget submit, required Endpoint endpoint, required Map<String, Object?> params, List<DslAction> onSuccess = const <DslAction>[], List<DslAction> onFailure = const <DslAction>[], FFActionTriggerType triggerType = FFActionTriggerType.ON_TAP}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Attaches a CRUD form submit API call to an existing submit trigger.
ensureEmptyState({required String page, required BrownfieldPatternTarget content, required Object? visibleWhen, required DslWidget emptyState, BrownfieldPatternTarget? insertBefore}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Inserts and wires an empty state beside existing content.
ensureLibraryComponentReuse({required String page, required BrownfieldPatternTarget anchor, required String libraryProjectId, required String componentName, required String componentKey, required Map<String, DslType> params, Map<String, Object?> arguments = const <String, Object?>{}, String? insertedName, bool after = true}) → void

Available on App, provided by the BrownfieldReusePatterns extension

Inserts a linked library component beside an existing anchor.
ensureListDetailNavigation({required String page, required BrownfieldPatternTarget item, required Object targetPage, required Map<String, Object?> params, FFActionTriggerType triggerType = FFActionTriggerType.ON_TAP}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Adds list-item navigation to an existing repeated item widget.
ensureProjectComponentReuse({required String page, required BrownfieldPatternTarget anchor, required String componentName, required Map<String, DslType> params, Map<String, Object?> arguments = const <String, Object?>{}, String? insertedName, bool after = true}) → void

Available on App, provided by the BrownfieldReusePatterns extension

Inserts an existing shared project component beside an existing anchor.
ensureRefreshAction({required String page, required List<DslAction> actions, BrownfieldPatternTarget? trigger, bool insertIntoAppBar = false, String name = 'RefreshAction', String icon = 'refresh', FFActionTriggerType triggerType = FFActionTriggerType.ON_TAP}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Ensures an existing trigger or app-bar action performs a refresh flow.
ensureSearchBar({required String page, required BrownfieldPatternTarget before, required String stateField, required String name, String hint = 'Search...', List<DslAction> onSubmit = const <DslAction>[]}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Inserts a named search field before an existing anchor and wires it to page-local string state.
ensureTextFieldStateBinding({required String page, required BrownfieldPatternTarget field, required String stateField, FFActionTriggerType triggerType = FFActionTriggerType.ON_TEXTFIELD_CHANGE, List<DslAction> afterSetState = const <DslAction>[]}) → void

Available on App, provided by the BrownfieldSemanticPatterns extension

Wires an existing text field to a page state field.
ensureThemeColorReuse({required String page, required BrownfieldPatternTarget target, required String tokenQuery, DslReuseResolutionPolicy policy = DslReuseResolutionPolicy.closestMatch}) → void

Available on App, provided by the BrownfieldReusePatterns extension

Replaces a literal color choice with a resolved theme token.
enum_(String name, Iterable<String> values, {String? description}) EnumHandle
Declares an enum for later type and expression use.
event(String name, {required AppEventScope scope, StructHandle? dataStruct, ActionBlockTarget? handler, String description = ''}) AppEventHandle
Declares a reusable app event.
extractRepeatedWidgetsToComponent({required String componentName, required List<BrownfieldPatternOccurrence> occurrences}) → void

Available on App, provided by the BrownfieldReusePatterns extension

Extracts repeated existing widgets into a shared project component and replaces each occurrence with a component instance.
firebaseAuth({required Iterable<FirebaseAuthProvider> providers, required Object homePage, required Object signInPage, bool autoCreateUserDocument = false, String? userCollectionName}) → void
Declares app-level Firebase auth behavior.
genUiAvatar(GenUiChatTarget chat, {String? assetPath, String? url}) → void
Configures the assistant avatar image shown by a GenUI chat.
genUiCatalogComponent(GenUiChatTarget chat, {required Object component}) → void
Adds a reusable component to a chat widget's GenUI catalog.
genUiEventListener(GenUiChatTarget chat, {required AppEventTarget event, String messageTemplate = '', bool autoRespond = false}) GenUiEventListenerHandle
Registers a local app event listener on a GenUI chat widget.
genUiHeader(GenUiChatTarget chat, {required String title}) → void
Configures the GenUI chat header title.
genUiMessageSpacing(GenUiChatTarget chat, {required double value}) → void
Configures message spacing on a GenUI chat widget.
genUiScrollBehavior(GenUiChatTarget chat, {required bool enabled}) → void
Configures whether the GenUI chat auto-scrolls as new messages arrive.
genUiSystemPrompt(GenUiChatTarget chat, {required String prompt}) → void
Overrides the widget-declared system prompt for a GenUI chat.
genUiTool(GenUiChatTarget chat, {required ActionBlockTarget actionBlock, String loadingMessage = 'Processing...', String description = ''}) GenUiToolHandle
Registers an app-level action block as a GenUI tool on a chat widget.
libraryComponent(String name, {required String libraryProjectId, required String componentKey, Map<String, DslType>? params}) LibraryComponentHandle
Returns a callable handle for a component exported by an attached library dependency.
libraryPage(String name, {required String libraryProjectId, required String pageKey, Map<String, DslType>? params}) LibraryPageHandle
Returns a handle for a page exported by an attached library dependency.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
page(String name, {String? description, required String route, Map<String, DslType>? params, Map<String, DslType>? state, List<DslAction>? onLoad, required DslWidget body, bool isInitial = false}) PageHandle
Declares a top-level page and returns a handle for navigation/shell use.
postgres({required String url, required String anonKey}) → void
Declares project-level generic Postgres backend configuration.
primaryFont(String fontFamily) → void
Sets the primary font family.
projectComponent(String name, {Map<String, DslType>? params}) ExistingProjectComponentHandle
Returns a callable handle for a component that already exists in the current target project.
raw(RawProjectMutation mutation) → void
Registers a raw mutation against the compiled FFProject.
secondaryFont(String fontFamily) → void
Sets the secondary font family.
state(String name, DslType type, {String? description, bool persisted = false}) → void
Declares one global app-state field.
struct(String name, Map<String, DslType> fields, {String? description}) StructHandle
Declares a struct with named fields.
supabase({required String url, required String anonKey, String? connectedProjectId, String? connectedProjectName, String? connectedRegion, SupabaseGoogleAuthConfig? googleAuth, SupabaseAppleAuthConfig? appleAuth}) → void
Declares project-level Supabase backend configuration.
supabaseAuth({required Iterable<SupabaseAuthProvider> providers, required Object homePage, required Object signInPage}) → void
Declares app-level Supabase auth behavior.
table(String name, {required Map<String, PostgresTableField> fields, String? description, bool isView = false}) PostgresTableHandle
Declares one shared SQL table for either Supabase or generic Postgres.
themeColor(String slot, int argb, {int? dark}) → void
Sets a theme color slot.
toString() String
A string representation of this object.
inherited

Operators

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