fossui library

fossui: an open-source Flutter UI library.

A single import for the theme system and widgets. Native Flutter theming, golden-tested components.

Classes

FossAlert
FossAlert, light theme FossAlert, dark theme
FossAlertDialog Overlays
FossAlertDialog, light theme FossAlertDialog, dark theme
FossAlertDialogStyle
Visual overrides for a single FossAlertDialog. An alert style is a FossDialogStyle: it carries the same fields and the alert composes a FossDialog, so it passes its style straight through. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme.
FossAlertStyle
Visual overrides for a single FossAlert. Every field is optional; a null field falls back to the value the variant and theme resolve. Pass one via style: to tweak a one-off without changing the theme.
FossAutocomplete Inputs
FossCombobox, light theme FossCombobox, dark theme
FossAvatar Layout
FossAvatar, light theme FossAvatar, dark theme
FossAvatarStyle
Visual overrides for a single FossAvatar. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other avatar.
FossBadge
FossBadge, light theme FossBadge, dark theme
FossBadgeStyle
Visual overrides for a single FossBadge. Every field is optional; a null field falls back to the value the variant and theme resolve. Pass one via style: to tweak a one-off without changing the theme.
FossButton Inputs
FossButton variants, light theme FossButton variants, dark theme
FossButtonController
Drives a FossButton imperatively, so loading and disabled can be toggled without rebuilding the button from new parameters. Pass one to a button's controller; you own it and must dispose it.
FossButtonStyle
Visual overrides for a FossButton. Every field is optional; a null field falls back to the value the theme resolves for the button's variant and size. Pass one to a single button via style: to tweak a one-off, without changing the theme for every other button.
FossCard Layout
FossCard, light theme FossCard, dark theme
FossCardStyle
Visual overrides for a single FossCard. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other card.
FossCheckbox Inputs
FossCheckbox, light theme FossCheckbox, dark theme
FossCheckboxGroup<T> Inputs
Lays out a set of FossCheckboxItem options as a multi-select group.
FossCheckboxItem<T>
A single option within a FossCheckboxGroup.
FossCheckboxStyle
Visual overrides for a single checkbox. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other checkbox.
FossColors
Semantic color roles, one field per role. light and dark are baked constant sets; every blend and translucent overlay is resolved to a fixed sRGB color, so no color math runs at runtime.
FossCombobox<T> Inputs
FossCombobox, light theme FossCombobox, dark theme
FossComboboxItem<T>
One option in a FossCombobox.
FossComboboxStyle
Visual overrides for a FossAutocomplete or FossCombobox. Every field is optional; a null field falls back to the theme-resolved value.
FossDialog Overlays
FossDialog, light theme FossDialog, dark theme
FossDialogStyle
Visual overrides for a single FossDialog. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other dialog.
FossDrawer Overlays
FossDrawer, light theme FossDrawer, dark theme
FossDrawerStyle
Visual overrides for a single FossDrawer. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other drawer.
FossMotion
Animation durations. Gate any token-driven animation on MediaQuery.disableAnimations so reduced-motion users get no motion.
FossMultiCombobox<T> Inputs
FossCombobox, light theme FossCombobox, dark theme
FossMultiSelect<T> Inputs
A pick-several-from-list control with no typing.
FossProgress
FossProgress, light theme FossProgress, dark theme
FossProgressStyle
Visual overrides for a single FossProgress. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other bar.
FossRadii
Corner radii in logical pixels. standard is the default scale; full is a pill sentinel, clamped to half the height at the use site.
FossRadio<T> Inputs
FossRadio, light theme FossRadio, dark theme
FossRadioGroup<T> Inputs
Lays out a set of FossRadio options as a single-choice group.
FossRadioStyle
Visual overrides for a single FossRadio. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other radio.
FossSelect<T> Inputs
FossSelect, light theme FossSelect, dark theme
FossSelectItem<T>
One option in a FossSelect or FossMultiSelect.
FossSelectStyle
Visual overrides for a single FossSelect or FossMultiSelect. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other select.
FossSeparator Layout
FossSeparator, light theme FossSeparator, dark theme
FossShadows
Layered drop shadows per elevation step. Each is a baked List<BoxShadow> (black at low alpha); none is an empty list. Resolved at author time, no shadow math at runtime.
FossSince
Records the fossui version a public API was introduced in.
FossSlider Inputs
FossSlider, light theme FossSlider, dark theme
FossSliderStyle
Visual overrides for a single FossSlider. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other slider.
FossSpacing
Spacing scale built from one unit (4 px). Call the instance to scale the unit (call) or build an inset (all); every step is unit * n.
FossSpinner
FossSpinner, light theme FossSpinner, dark theme
FossSwitch Inputs
FossSwitch, light theme FossSwitch, dark theme
FossSwitchStyle
Visual overrides for a single switch. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other switch.
FossTab<T>
One tab: its value, label, optional leading icon and content panel, and whether it is enabled.
FossTabs<T> Layout
FossTabs, light theme FossTabs, dark theme
FossTabsStyle
Visual overrides for a single FossTabs. Every field is optional; a null field falls back to the value the theme resolves for the chosen variant. Pass one via style: to tweak a one-off without changing the theme for every other tab set.
FossTextField Inputs
FossTextField, light theme FossTextField, dark theme
FossTextFieldStyle
Visual overrides for a FossTextField. Every field is optional; a null field falls back to the value the theme resolves for the size and state. Pass one to a single field via style: to tweak a one-off, without changing the theme for every other field.
FossTheme
Provides a FossThemeData to its subtree for non-Material apps. Material apps can instead register the theme in ThemeData.extensions; either way context.fossTheme resolves it.
FossThemeData
The root token bundle: the six leaf bundles in one object. Register it once, then read everything through context.fossTheme. FossThemeData.light and FossThemeData.dark are the defaults; build your own to retheme the app.
FossThemeSpec
A compact override layer for retheming a FossThemeData in one call.
FossToast Overlays
FossToast, light theme FossToast, dark theme
FossToastController
Owns the queue of live toasts and their auto-dismiss timers. Shared by a FossToaster and read with FossToastScope.of. Notifies on every change.
FossToastEntry
A live toast in a FossToastController's queue.
FossToaster Overlays
Hosts transient toasts over its child. Mount it once near the app root, above everything that needs to raise a toast.
FossToastHandle
A handle to a raised toast, returned by showFossToast. Holds the toast's id and its toaster so the caller can dismiss it early or update its message without threading a BuildContext back in.
FossToastScope
Shares a FossToastController with the subtree. Read it with FossToastScope.of; provided by a FossToaster.
FossToastStyle
Visual overrides for a single FossToast. Every field is optional; a null field falls back to the value the theme resolves.
FossTooltip Overlays
FossTooltip, light theme FossTooltip, dark theme
FossTooltipStyle
Visual overrides for a single FossTooltip. Every field is optional; a null field falls back to the value the theme resolves. Pass one via style: to tweak a one-off without changing the theme for every other tooltip.
FossTypography
Text styles per size step. Each carries family, size, line height, and letter spacing; set weight with the FossTextStyleWeight getters (.medium for labels and buttons, .semibold for headings, .bold for emphasis).

Enums

FossAlertVariant
The status of a FossAlert, driving its border, fill, and leading glyph.
FossAvatarSize
The size axis of a FossAvatar. Selects the square box edge and the fallback text step; md (32) is the default.
FossBadgeSize
The size axis of a FossBadge: the pill height, minimum width, horizontal padding, and type step. md is the default.
FossBadgeVariant
The color axis of a FossBadge. primary is the default solid pill; secondary, outline, and destructive complete the solid set; info, success, warning, and error are soft, tinting the role at low alpha.
FossButtonSize
The size of a FossButton.
FossButtonStatus
The interactive status a FossButtonController holds. The three states are mutually exclusive: idle is the normal, enabled state.
FossButtonVariant
The visual treatment of a FossButton.
FossCheckboxGroupVariant
The visual treatment of a FossCheckboxGroup.
FossDialogFooterVariant
The footer treatment shared by the dialog and the alert dialog.
FossDialogPresentation
How a modal presents: a centered card or a bottom-stuck sheet.
FossDrawerFooterVariant
The footer treatment of a FossDrawer.
FossDrawerSide
The edge a FossDrawer anchors to and slides in from.
FossDrawerVariant
The corner treatment of a FossDrawer surface.
FossRadioGroupVariant
The visual treatment of a FossRadioGroup.
FossSelectSize
The height and type scale of a FossSelect or FossMultiSelect trigger.
FossSeparatorOrientation
The axis a FossSeparator runs along.
FossTabsOrientation
The axis the tab strip runs along.
FossTabsVariant
The two tab looks.
FossTextFieldSize
The size of a FossTextField.
FossToastVariant
The kind of a FossToast: drives the leading glyph, its tint, and whether the toast auto-dismisses.
FossTooltipSide
The side of the anchor a FossTooltip prefers to open on. The popup flips to the opposite side when it would overflow the viewport.

Extensions

FossTextStyleWeight on TextStyle
Weight conveniences on a TextStyle, for use on the FossTypography scale.
FossThemeContext on BuildContext
The single way to read fossui tokens.

Functions

fieldMetrics(FossThemeData theme, FossTextFieldSize size) → ({Color fill, double minHeight, double padX, double radius})
The size-driven field geometry: resting fill, corner radius, minimum height, and horizontal inset. Shared so every field surface (single-line input, chips input) resolves the same box from the same size.
showFossAlertDialog<T>({required BuildContext context, required WidgetBuilder builder, FossDialogPresentation presentation = FossDialogPresentation.bottomSheet, String? barrierLabel, bool useRootNavigator = true}) Future<T?>
Opens a non-dismissible alert dialog and resolves to the value passed to Navigator.pop.
showFossDialog<T>({required BuildContext context, required WidgetBuilder builder, FossDialogPresentation presentation = FossDialogPresentation.bottomSheet, bool barrierDismissible = true, String? barrierLabel, bool useRootNavigator = true}) Future<T?>
Opens a modal dialog and resolves to the value passed to Navigator.pop.
showFossDrawer<T>({required BuildContext context, required WidgetBuilder builder, FossDrawerSide side = FossDrawerSide.bottom, bool barrierDismissible = true, String? barrierLabel, bool useRootNavigator = true}) Future<T?>
Opens an edge FossDrawer and resolves to the value passed to Navigator.pop.
showFossToast(BuildContext context, FossToast toast) FossToastHandle
Raises toast on the nearest FossToaster and returns a FossToastHandle to dismiss or update it.