Model selector
The model picker for the composer's trailing slot — effort section, overflow, sheet on phones.
FlowModelSelector is the compact model picker made for the composer’s
trailing slot: a menu of FlowModelOptions with descriptions, an optional
Effort section, and an overflow behind a More models row. Picking a
model or an effort applies immediately and closes the menu — no confirm
step.
The picker
Section titled “The picker”FlowModelSelector( tooltip: 'Choose model', models: [ FlowModelOption( id: 'fable-5', label: 'Fable 5', description: 'Our flagship model', ), FlowModelOption( id: 'opus-5-1', label: 'Opus 5.1', description: 'For complex & thinking tasks', ), FlowModelOption( id: 'haiku-4-5', label: 'Haiku 4.5', description: 'Fastest for quick answers', ), ], selectedId: selectedModelId, onSelected: (id) => setModel(id), // Optional: an Effort section. Picking a model or an effort // applies immediately and closes the menu. efforts: [ FlowEffortOption( id: 'low', label: 'Low', description: 'Quickest replies. Simple answers', ), FlowEffortOption( id: 'max', label: 'Max', description: 'Complex, extensive tasks', ), ], selectedEffortId: selectedEffortId, onEffortSelected: (id) => setEffort(id), // Optional: overflow models behind a 'More models' row. moreModels: [ FlowModelOption(id: 'sonnet-4-5', label: 'Sonnet 4.5'), ], // Presentation is automatic: an anchored menu on desktop, a // bottom sheet on iOS and Android. FlowMenuPresentation.menu / // .sheet force either. sheetTitle: 'Select model',)Presentation follows the platform
Section titled “Presentation follows the platform”On desktop the selector anchors a menu at the trigger; on iOS and Android
it presents a bottom sheet titled with sheetTitle. That’s the auto
default — FlowMenuPresentation.menu or .sheet force either. Effort and
More models become pushed pages inside the sheet. The sheet rides the
Material modal route, so a host not built on MaterialApp needs
DefaultMaterialLocalizations.delegate among its
localizationsDelegates.
Key API
Section titled “Key API”models/selectedId/onSelected— the primary list;FlowModelOptioncarriesid,label,description, andenabled.efforts/selectedEffortId/onEffortSelected— the optional Effort section (FlowEffortOption, same shape). Wheneffortsis non-empty, the other two are required — a debug assert fires otherwise.moreModels— overflow options behind More models.sheetTitle,tooltip— host-supplied strings.effortLabelandmoreModelsLabel— the widget’s two pieces of shipped copy ('Effort','More models'), shown on those rows and as their sheet-page titles; override both to localize.presentation—FlowMenuPresentation.auto(default) /.menu/.sheet.menuStyle— aFlowMenuStylefor per-instance retheming;enabled: falsemutes the trigger.