AppComponentMeta class

Type-safe descriptor of a Flocks component.

It is the source of truth for the metadata an MCP server serves to AI tools (what a component is, when and how to use it) and for the per-component routes the site generates. Preferred over hand-written JSON because it is refactor-safe and derivable from the component's own enums and knobs. Every migrated component must declare its props — that is what the MCP serves — and tool/component_conformance.dart fails the build when one does not (Rule 6).

Constructors

AppComponentMeta({required String id, required String name, required ComponentCategory category, required ComponentStatus status, required LocalizedText summary, LocalizedText? description, LocalizedList whenToUse = const LocalizedList.empty(), LocalizedList whenNotToUse = const LocalizedList.empty(), List<PropMeta> props = const <PropMeta>[], List<String> variants = const <String>[], List<String> states = const <String>[], List<CodeExample> examples = const <CodeExample>[], LocalizedList dos = const LocalizedList.empty(), LocalizedList donts = const LocalizedList.empty(), LocalizedText? a11y, bool crossPlatform = false, bool themeAware = false, bool reducesMotion = false, List<String> related = const <String>[]})
Creates an AppComponentMeta.
const

Properties

a11y LocalizedText?
Accessibility notes (Gate 8).
final
category ComponentCategory
Atomic category.
final
crossPlatform bool
Meets the cross-platform gate (selection/focus) — Gate 7.
final
description LocalizedText?
Long description.
final
donts LocalizedList
Antipatterns (don't).
final
dos LocalizedList
Good practice (do).
final
examples List<CodeExample>
Usage examples.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Identifier (snake_case, e.g. app_button).
final
name String
Public class name (e.g. AppButton).
final
props List<PropMeta>
Public props.
final
reducesMotion bool
Honors reduce-motion — Gate 10.
final
Related components (ids).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states List<String>
Supported interaction states.
final
status ComponentStatus
Migration state.
final
summary LocalizedText
One-line summary.
final
themeAware bool
Reads 100% from the theme and adapts to light/dark + brand — Gate 9.
final
variants List<String>
Variants (e.g. color, size, icon-only).
final
whenNotToUse LocalizedList
When NOT to use it (with alternatives).
final
whenToUse LocalizedList
When to use it.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Serializes to the JSON consumed by the MCP server and the site.
toString() String
A string representation of this object.
inherited

Operators

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