consona_mobile library

Backwards-compatible barrel re-exporting consona_flutter.

Classes

AudioBackend
Backend contract. Implementations must call the attached callbacks reliably.
AudioEngine
Pure-Dart audio state machine — one instance per player surface.
AudioPlaybackState
AudioplayersAudioBackend
Production AudioBackend backed by audioplayers.
AudioplayersSoundPlayer
Concrete SoundPlayer adapter using audioplayers to play synthesized PCM WAV bytes.
AudioRecorderBackend
Abstract capture backend — one instance per AudioRecorderEngine.
AudioRecorderEngine
Pure Dart recorder engine — one instance per recorder surface.
AudioRecorderState
AudioRecordingResult
AudioTrack
BundledAsset
ConsonaAccordion
Expandable accordion list container.
ConsonaAccordionItem
ConsonaActionSheet
iOS-style action sheet built on ConsonaDrawer with grouped actions + cancel.
ConsonaActionSheetItem
One action row inside ConsonaActionSheet.
ConsonaAlert
Persistent inline callout box for status messages, form errors, warnings, and contextual guidance. Adapts layout automatically between compact mobile and wide desktop/tablet viewports.
ConsonaAppBar
A scroll-aware top navigation bar with optional frosted glass blur, leading/trailing action slots, and hairline divider.
ConsonaAsset
ConsonaAssetCache
ConsonaAssetEntry
ConsonaAssetLibrary
ConsonaAssetsPlugin
ConsonaAudioArtwork
Resolves track artwork from an ImageProvider, URL, or placeholder.
ConsonaAudioPlayer
Minimalist composite audio player surface (delegates to ConsonaAudioPlayerCard).
ConsonaAudioPlayerCard
Full audio player card with optional poster, track info, and timeline.
ConsonaAudioPlayerPill
Stadium player: one solid left capsule + morphing timeline track.
ConsonaAudioPlugin
Marks the audio module as available.
ConsonaAudioRecorderCard
Full recorder card: live levels, stop/pause, review, resume, restart.
ConsonaAudioRecorderPill
Compact stadium recorder: idle → recording → review (morph + resume).
ConsonaAutocomplete<T>
Typeahead field that filters items as the user types and commits a selection via tap or keyboard (↑/↓ + Enter, Escape to dismiss).
ConsonaAvatar
Circular or squircle user identity avatar with image provider, initials fallback, and optional presence status badge.
ConsonaAvatarGroup
Overlapping horizontal stack of ConsonaAvatar items with a +N overflow counter pill.
ConsonaBadge
ConsonaBanner
Edge-to-edge page banner for system notices, maintenance, and billing.
ConsonaBeforeAfterSlider
Interactive before-and-after comparison slider with draggable hairline handle, directional keyboard navigation, and tactile feedback.
ConsonaBentoGrid
Responsive mobile bento grid container.
ConsonaBentoTile
Individual tile in a ConsonaBentoGrid.
ConsonaBorder
ConsonaBorderSpec
ConsonaBreadcrumbItem
A single node in a ConsonaBreadcrumbs trail.
ConsonaBreadcrumbs
Hierarchical path bar (Workspace / Projects / Audio Synth) that automatically collapses middle items into an interactive … pill on narrow mobile viewports (< collapseWidth).
ConsonaBreakpoints
ConsonaButton
ConsonaButtonThemeData
ConsonaButtonVariant
ConsonaCamera
Bottom-card camera capture flow (capture → review → confirm).
ConsonaCameraCaptureResult
Confirmed photo or video from the camera sheet.
ConsonaCard
Compound card container with fail-closed defaults and dual-axis parts.
ConsonaCardThemeData
ConsonaCarousel
Snap-scrolling horizontal carousel that adapts item width on wide desktop viewports and provides hover arrow controls + animated pill pagination dots.
ConsonaCheckbox
ConsonaChip
ConsonaChoiceBox
ConsonaColorPicker
Color selection control. The swatch trigger opens a Solid / Gradient / Image editor. value/onChanged drive the solid color; gradient & image fills are emitted through onGradientChange / onImageFillChange.
ConsonaColorPresetItem
A named preset color (display name + hex string).
ConsonaColors
Semantic colors for Consona Mobile components.
ConsonaColorScheme
ConsonaCommandItem
A single actionable command entry in ConsonaCommandPalette.
ConsonaCommandPalette
Spotlight (⌘K / Ctrl+K) command launcher supporting instant query filtering, grouped categories, keyboard Up/Down/Enter navigation, and ConsonaKbd shortcut pills.
ConsonaComponentThemes
ConsonaContextMenu
Anchored popup context menu.
ConsonaContextMenuItem
ConsonaCopyable
ConsonaCounter
Compact stepper with minus/plus buttons and hold-to-repeat acceleration.
ConsonaCountryPickerSheet
ConsonaCurves
Reusable soft curves and physics simulations.
ConsonaDatePicker
Tactile calendar with month/year pickers and optional range selection.
ConsonaDatePickerResult
Result returned from drawer presentations of the date picker.
ConsonaDateTimeGeometry
Pixel-snapped layout constants shared by calendar, month/year, and step tabs.
ConsonaDateTimePicker
Combined date and time picker presented as a multi-step drawer.
ConsonaDensity
ConsonaDestination
A single destination: how it is shown in the nav and the page it owns.
ConsonaDivider
A 1 / devicePixelRatio hairline divider supporting horizontal and vertical orientations and an optional centered label (e.g. ─── OR ───).
ConsonaDrawer
Partial-height bottom drawer with multi-snap detents and velocity dismiss.
ConsonaDrawerHandle
Slim grabber used by bottom drawers.
ConsonaDrawerHeader
Convenience header used inside drawers.
ConsonaEmailField
Specialized email field with RFC validation and domain suggestion chips.
ConsonaEmptyState
Structured empty/zero-data placeholder card with icon badge, title, description, and optional primary action slot.
ConsonaEngine<TState>
Base engine managing reactive state snapshots, batching, event-bus messaging, and storage synchronization completely detached from Flutter widgets.
ConsonaEventBus
Domain event bus supporting exact and wildcard subscriptions.
ConsonaFab
Primary floating action — circular icon or extended pill with label.
ConsonaFeedbackPlugin
ConsonaFileCard
Card-format file attachment displaying semantic extension badges, file size, upload progress, and download/remove actions.
ConsonaFileDropzone
Responsive file dropzone and upload queue surface for desktop/web drag-or-click and mobile tap-to-browse workflows.
ConsonaFileRow
Dense row format for attachments and file tables.
ConsonaFileViewerModal
Universal multi-format file & document viewer modal. Auto-detects and displays interactive zoomable images, syntax/log text, audio players, or document inspection cards.
ConsonaGeometries
Shared optical geometry — one tone for buttons, inputs, nav, pickers, OTP.
ConsonaGradientConfig
Full gradient configuration (type + angle + stops).
ConsonaGradientStop
A single gradient color stop.
ConsonaHitTarget
Wraps interactive elements to enforce platform-minimum touch targets (44×44pt on iOS/macOS, 48×48dp on Android/others).
ConsonaIconButton
ConsonaImage
Progressive image loader with memory downsampling, blur/shimmer placeholder, and fail-closed error fallback.
ConsonaImageFillConfig
Non-destructive image fill configuration with scale mode + adjustments.
ConsonaImageFillLayer
Paints an image fill with the same geometry as the web editor: center at (positionX%, positionY%), crop zoom as box size, tile zoom as scale. Do not use Image.alignment for pan — cover vs contain invert optical drag direction.
ConsonaInfiniteScroll<T>
Scrollable list that requests the next page when the user nears the end.
ConsonaInputThemeData
ConsonaInteractionStateBuilder
Tracks pressed, hovered, and focused flags for a component and resolves the effective ConsonaInteractionState.
ConsonaKbd
ConsonaLightbox
Full-screen media viewer modal featuring pinch-to-zoom, pan, desktop arrow navigation, and an interactive bottom thumbnail filmstrip gallery.
Inline navigational / action text — lighter than ConsonaButton.plain, with underline and external-affordance support.
ConsonaListTile
ConsonaLoader
ConsonaMediaGrid
Mosaic media gallery. Four or more items render as a square 2×2 grid; the bottom-right tile shows a light +N overlay for remaining items. Tapping a tile opens ConsonaLightbox.
ConsonaMediaItem
Immutable descriptor for an inspectable media asset or file.
ConsonaMeter
Segmented capacity / level meter with automatic semantic threshold coloring (success -> warning -> danger as capacity approaches 100%).
ConsonaMiniVisualizer
Six-bar mini visualizer used inside player / recorder pills.
ConsonaModal
Centered modal dialog with slide open/close motion.
ConsonaMorphFill
Clips child to progress from the leading edge, with a full-radius stadium tip on the trailing edge so the fill never looks square-cut.
ConsonaMotion
ConsonaMotionSpec
ConsonaMultiSelect<T>
Multi-value picker that surfaces selections as removable chips and opens a searchable checkbox sheet for adding/removing values.
ConsonaNav
ConsonaNumberField
Typed numeric field for amounts, quantities, and measurements.
ConsonaOpacities
ConsonaOtpField
Tactile OTP / PIN entry component with auto-advance and paste handling.
ConsonaOverlayBackdrop
Dim/blur barrier that tracks progress but never translates with the panel.
ConsonaOverlayBody
Overflow-safe body for drawer / sheet content.
ConsonaOverlayItem
ConsonaOverlayPlugin
ConsonaOverlayState
ConsonaOverlayText
Text that never paints overflow stripes inside overlay chrome.
ConsonaOverlayThemeData
ConsonaPagination
Standalone pagination footer with prev/next, optional page numbers, and a compact “Showing X–Y of Z” summary that stacks on narrow viewports.
ConsonaPasswordField
Password field with eye visibility toggle and password strength bar.
ConsonaPhoneField
International phone number input well with country picker and vertical divider.
ConsonaPickerSegmented
Fixed-height segmented control matching the active optical control height.
ConsonaPill
Lightweight non-filter meta pill. Prefer ConsonaChip for selectable filters and ConsonaBadge for overlay counts.
ConsonaPinVerification
High-level PIN / OTP verification composite combining ConsonaOtpField, header/subtitle text, a live resend countdown timer, and action buttons.
ConsonaPlugin
Contract for extending the Consona library with engines, asset sources, theme extensions, event-bus hooks, and slot overrides.
ConsonaPluginRegistry
Concrete implementation of ConsonaRegistry supporting plugin lifecycle, topological ordering, and rollback on failure.
ConsonaPopover
Rich interactive popover that opens beside the trigger on every viewport.
ConsonaPresets
ConsonaPressStateBuilder
Tracks a pressed flag for a component and hands it to builder together with the callback to wire into ConsonaSpringPress.onPressedChanged.
ConsonaProgress
Determinate progress bar with animated fill and optional percentage readout.
ConsonaProvider
ConsonaPullToRefresh
Wraps a scrollable child with an elastic pull-down refresh indicator that fires a haptic tick when crossing triggerOffset.
ConsonaRadii
ConsonaRadio<T>
ConsonaRadius
ConsonaRangeSlider
A dual-thumb continuous or discrete range slider with horizontal pill-shaped thumbs using theme.colors.background fill and theme.colors.primary border.
ConsonaRating
Tactile star or heart rating bar with drag scrubbing and haptic ticks.
ConsonaRecordingPreview
Real audio preview for recorder review (card / pill).
ConsonaRegistry
ConsonaScrollArea
Wraps a scrollable. Scroll sound is intentionally disabled — only swipe cues play elsewhere (e.g. ConsonaSwipeableTabPager).
ConsonaScrollView
Convenience ListView already wrapped in ConsonaScrollArea.
ConsonaSearchField
Search field well with debounced emission, clear affordance, and filter pill slot.
ConsonaSection
ConsonaSegment<T>
A single segment definition for ConsonaSegmentedControl.
ConsonaSegmentedControl<T>
Magnetic segmented tab switcher with a sliding pill indicator that elongates mid-flight (squash-and-stretch) when switching segments.
ConsonaSelect<T>
Tap-to-sheet picker well that opens a modal list sheet.
ConsonaShadow
ConsonaSheet
Full-screen edge sheet — covers the viewport, dismissible by drag or close.
ConsonaShell
ConsonaShellNavContext
Everything a custom header / nav / page needs to know about the shell.
ConsonaShellScope
Exposes the shell state (selected destination, window class) to pages.
ConsonaShowMore
Expandable content control — clamp long copy, or a divider with a toggle.
ConsonaSizeScope
An InheritedWidget providing ambient ConsonaOpticalSize to descendants.
ConsonaSkeleton
ConsonaSlider
Tactile continuous or discrete slider with a horizontal pill-shaped thumb (theme.colors.background fill + theme.colors.primary border).
ConsonaSlot<T>
Addressable injection point that resolves:
ConsonaSlots
Resolves registry slot overrides from the nearest ConsonaProvider.
ConsonaSnippet
Copyable monospace snippet for tokens, commands, and short code.
ConsonaSnippetTab
One language / file pane inside a multi-tab ConsonaSnippet.
ConsonaSpacing
ConsonaSplitView
Responsive resizable split-pane container.
ConsonaSpringPress
ConsonaStatusDot
Compact status indicator with optional breathing pulse and adjacent label.
ConsonaStep
A single step definition for ConsonaStepper.
ConsonaStepper
Multi-step progress and wizard navigation indicator supporting horizontal and vertical orientations.
ConsonaStorageAdapter
ConsonaStroke
ConsonaSurfaceReveal
Fade, scale, and short slide that reverses on dismiss.
ConsonaSwipeableTabPager
Swipe left/right between sibling pages with soft settling motion.
ConsonaSwipeAction
ConsonaSwipeDismiss
Wraps child so horizontal or vertical swipes beyond dismissThreshold or with sufficient fling velocity animate out and invoke onDismissed.
ConsonaSwipeItem
ConsonaSwitch
ConsonaSynthRecipe
ConsonaTable<T>
Unified, token-driven Table & DataTable component.
ConsonaTableColumn<T>
Column definition for ConsonaTable.
ConsonaTagInput
Multi-token input field that renders selected tags as inline removable ConsonaChip pills alongside an inline text input and optional quick-add suggestion chips.
ConsonaText
ConsonaTextArea
Multiline text area with auto-expanding lines and character counter.
ConsonaTextField
Form text field well supporting floating label, error shake, and clear button.
ConsonaTheme
ConsonaThemeConfig
ConsonaThemeController
ConsonaThemeData
ConsonaThemeScope
An InheritedWidget to locally override or provide ConsonaThemeData for a specific subtree without modifying the global ThemeData.
ConsonaTimeline
Vertical activity/event stream with status nodes, connecting hairlines, and responsive timestamp placement (dedicated leading column on wide screens, inline header on compact mobile screens).
ConsonaTimelineItem
A single event entry in a ConsonaTimeline.
ConsonaTimelineScrubber
Tactile precision audio timeline scrubber with time readout.
ConsonaTimePicker
Tactile multi-wheel time picker for hours, minutes, and AM/PM.
ConsonaToastController
Controller managing toast queues, styles, and auto-dismiss timers.
ConsonaToastEntry
ConsonaToastLayer
App-level toast host for MaterialApp.builder.
ConsonaToastScope
Provides an ambient ConsonaToastController to descendants.
ConsonaToastStack
Floating toast host — one shared layout clock for enter + stack shift.
ConsonaToastStyle
Resolves colors + default poster for a toast card.
ConsonaToolbar
Thin floating capsule action chrome — short vertically, scrolls horizontally.
ConsonaToolbarDivider
Marker for a vertical hairline between toolbar groups.
ConsonaTooltip
Tactile callout balloon tooltip supporting both desktop mouse hover and mobile long-press.
ConsonaTree
Hierarchical disclosure tree with springy expand rows and optional selection.
ConsonaTreeNode
Node model for ConsonaTree.
ConsonaTypography
ConsonaUploadItem
Represents a file item in ConsonaFileDropzone.
ConsonaVariantBuilder<T>
Base contract for callable variant builders produced by .extend().
ConsonaVideoController
Thin reactive wrapper around a vp.VideoPlayerController.
ConsonaVideoPlayer
Compact video player with poster, scrubber, volume, and extensible settings.
ConsonaWaveform
Interactive audio waveform bar visualizer with touch scrubbing.
ConsonaWheelPicker<T>
Generic cylindrical scroll wheel picker with detent clicks and lens magnification.
CountryCode
DefaultSoundCues
Soft, soothing UI sound kit.
FeedbackConfig
FeedbackEngine
FeedbackScope
HapticEngine
MemoryStorageAdapter
In-memory storage adapter for tests and ephemeral sessions.
MockAudioBackend
MockAudioRecorderBackend
Simulated mic for previews / tests — no platform permissions.
NetworkAsset
NoopSoundPlayer
Fallback no-op player that operates silently without errors or latency.
OverlayEngine
Pure Dart overlay state machine and priority manager.
OverlayScope
RecordAudioRecorderBackend
Mic-backed AudioRecorderBackend using the record package.
RgbaColor
Straight-alpha RGBA color. Channels are 0..255, alpha is 0..1.
SharedPrefsStorageAdapter
SharedPreferences storage adapter for cross-session mobile persistence.
SoundEngine
SoundEnvelope
SoundLibrary
SoundPlayer
SoundRecipe
SynthAsset
SystemSoundPlayer
Fallback system click player using platform standard SystemSound.

Enums

AudioPlaybackStatus
AudioRecorderStatus
ButtonState
Interactive button lifecycle states.
ConsonaAssetKind
ConsonaAudioPlayerPillSize
ConsonaAudioPlayerStyle
ConsonaAudioPlayerTimeline
ConsonaAudioRecorderPillSize
ConsonaAvatarSize
Size presets for ConsonaAvatar.
ConsonaAvatarStatus
Presence status indicator for ConsonaAvatar.
ConsonaBorderEdge
Border directional edges.
ConsonaBorderRole
Border roles for semantic borders.
ConsonaBorderStrategy
Border vs shadow rendering strategy.
ConsonaBorderStyle
Border styling modes.
ConsonaCapturedMediaKind
Kind of media captured from ConsonaCamera.
ConsonaCardVariant
ConsonaColorFormat
Active color notation for the format inputs row.
ConsonaDatePickerMode
Selection mode for ConsonaDatePicker.
ConsonaDensityPreset
Density scale presets.
ConsonaFillType
Root fill mode of the color picker.
ConsonaGradientType
Gradient geometry.
ConsonaImageScaleMode
How an image fill is scaled inside its frame.
ConsonaIntent
Semantic color intent roles for components.
ConsonaInteractionState
General component interaction states for token resolution.
ConsonaLinkUnderline
Underline decoration ramp for ConsonaLink.
ConsonaMediaType
High-level classification of media and file types.
ConsonaMotionRole
Motion roles for animation duration and curve resolution.
ConsonaMotionSoftness
ConsonaNavIndicator
Visual style of the selection indicator.
ConsonaNavPlacement
Which screen edge the nav is laid out for.
ConsonaNavVariant
Surface treatment of the nav.
ConsonaOpticalSize
Optical sizing roles scaling geometry, font, and padding.
ConsonaOtpVariant
ConsonaOverlayEdge
Edge a sheet/drawer may enter from.
ConsonaOverlayPriority
ConsonaRadiusPreset
Whole-theme or per-component radius preset options.
ConsonaRadiusRole
Optical roles for curvature/radius scaling.
ConsonaShadowLevel
Elevation and depth levels for ambient tinted shadows.
ConsonaShapeVariant
Shape and corner geometry variants.
ConsonaSheetDirection
ConsonaShellWide
Wide-screen layout property of ConsonaShell (used at expanded widths).
ConsonaSnippetVariant
Display mode for ConsonaSnippet.
ConsonaStatusKind
Semantic presence / health states mapped onto ConsonaIntent colors.
ConsonaStrokePreset
Stroke / border width presets.
ConsonaTagInputLayout
How selected tags arrange inside the input well.
ConsonaTextRole
Optical typography role hierarchy.
ConsonaThemeMode
Theme mode selection.
ConsonaToastVariant
Built-in toast kinds — map to ConsonaToastStyle presets.
ConsonaVideoStatus
Playback lifecycle for ConsonaVideoController.
ConsonaWindowClass
FeedbackEvent
FeedbackProfile
HapticIntensity
PasswordStrength
SoundWaveform

Constants

kDarkColorPresets → const List<ConsonaColorPresetItem>
Moody dark presets.
kDefaultImageFillConfig → const ConsonaImageFillConfig
kGradientPresets → const List<({ConsonaGradientConfig config, String name})>
Curated designer gradient presets (mirrors DEFAULT_GRADIENT_PRESETS).
kSoftColorPresets → const List<ConsonaColorPresetItem>
50 soft pastel / neutral presets.

Functions

audioPlayerFormatTime(Duration d) → String
Convenience re-export of timestamp helper for card consumers.
buildDemoToneWav({double frequency = 220.0, double durationMs = 2400.0, double gain = 0.22}) → Uint8List
consonaModalSlideTransition({required Animation<double> animation, required Widget child, Curve curve = ConsonaCurves.subtleEase, Curve reverseCurve = ConsonaCurves.easeOut}) → Widget
Centered modal — short upward slide only.
consonaOverlayMotionDuration(Duration duration) → Duration
Keeps a reveal long enough to read on open and on close. A zero duration (reduced motion) stays instant.
consonaSlideTransition({required Animation<double> animation, required ConsonaOverlayEdge edge, required Widget child, Curve curve = ConsonaCurves.subtleEase, Curve reverseCurve = ConsonaCurves.easeOut}) → Widget
Pure slide — no fade, no scale. Full off-screen → settled.
formatAudioTimestamp(Duration duration) → String
Formats duration as m:ss or h:mm:ss with tabular-friendly padding.
gradientToCss(ConsonaGradientConfig config) → String
Serialize a ConsonaGradientConfig to a CSS gradient string.
imageFillColorMatrix(ConsonaImageFillConfig c) → List<double>
Build a 4x5 color matrix approximating the interface CSS filter chain (getImageFillFilter): exposure/highlights → brightness, contrast/shadows → contrast, saturation → saturate, temperature/tint → warm shift + hue rotate.
parseCssGradient(String css) → ConsonaGradientConfig?
Parse a CSS gradient string into a ConsonaGradientConfig, or null.
rgbToHex(int r, int g, int b, [double a = 1.0]) → String
Convert RGB (0-255) to a #RRGGBB or #RRGGBBAA string.
showConsonaOverlay<T>({required BuildContext context, required Widget builder(BuildContext overlayContext, Animation<double> animation), bool barrierDismissible = true, String barrierLabel = 'Dismiss', Duration? transitionDuration, bool useRootNavigator = true, RouteSettings? settings, ConsonaOverlayPriority priority = ConsonaOverlayPriority.sheet}) → Future<T?>
Production showGeneralDialog wrapper.

Typedefs

ButtonStyleResolver = ({Color background, BoxBorder border, Color foreground, List<BoxShadow> shadows}) Function({BuildContext? context, required ConsonaInteractionState state, required ConsonaThemeData theme})
ConsonaAudioArtworkBuilder = Widget Function(BuildContext context, AudioPlaybackState state, ImageProvider<Object>? artwork)
ConsonaAudioControlsBuilder = Widget Function(BuildContext context, AudioPlaybackState state, VoidCallback onPlayPause)
ConsonaAudioErrorBuilder = Widget Function(BuildContext context, AudioPlaybackState state, String message)
ConsonaAudioPillArtworkBuilder = Widget Function(BuildContext context, AudioPlaybackState state, ImageProvider<Object>? artwork)
ConsonaAudioPillControlsBuilder = Widget Function(BuildContext context, AudioPlaybackState state, VoidCallback onPlayPause)
ConsonaAudioPillTitleBuilder = Widget Function(BuildContext context, AudioPlaybackState state, String message)
ConsonaAudioTimelineBuilder = Widget Function(BuildContext context, AudioPlaybackState state)
ConsonaAudioTitleBuilder = Widget Function(BuildContext context, AudioPlaybackState state, String title, String? artist)
ConsonaCameraEditCallback = Future<ConsonaCameraCaptureResult?> Function(BuildContext context, ConsonaCameraCaptureResult draft)
Optional hook to open an app-specific editor after capture.
ConsonaDialog = ConsonaModal
Back-compat name for ConsonaModal. Prefer ConsonaModal for new code.
ConsonaEventListener = void Function(Object? payload)
ConsonaFeedbackScope = FeedbackScope
Convenience alias matching Consona naming convention.
ConsonaLightboxMoreMenuBuilder = Widget Function(BuildContext context, ConsonaMediaItem item)
Builds overflow-menu content for the lightbox more button.
ConsonaNavItemBuilder = Widget Function(BuildContext context, ConsonaDestination destination, bool selected, VoidCallback onTap)
Custom builder for a single nav destination item.
ConsonaOverlayScope = OverlayScope
ConsonaSlotBuilder<T> = Widget? Function(BuildContext context, T props)
StateListener = void Function()
StateUpdater<TState> = TState Function(TState prev)