You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Flutter UI component library with dot-grid mesh, starfield particles, and CRT-style effects. Provides themed, accessible widgets with a terminal-inspired visual identity.
! Not ready for production use
Quick start
import'package:termos_ui/termos_ui.dart';
// Wrap your app (or subtree) with TermosTheme:TermosTheme(
data:TermosThemeData.dark(),
child:MyApp(),
)
// Or register as a ThemeExtension on MaterialApp's ThemeData:ThemeData(
extensions: [TermosThemeData.dark()],
)
Widgets resolve the theme via TermosTheme.of(context), which checks the TermosTheme InheritedWidget first, then falls back to Theme.of(context).extension<TermosThemeData>(), then to a brightness-based default.
Time picker band, scanlines, colon pulse, font sizes
TermosThemeData aggregates all tokens and supports copyWith, lerp (for animated theme transitions), and light/dark factory constructors.
Widgets
Widget
Description
TermosButton
Primary CTA with dot-grid mesh and starfield; loading/saved states with typing animation
TermosBackButton
Compact back control with starfield
TermosNavBar
Bottom tab bar with animated top-edge glow and page-controller sync
TermosSegmentedSelector
Horizontal segments with glow and starfield
TermosSlider
Discrete tick strip (delegates to TermosFloatingSlider)
TermosFloatingSlider
Draggable discrete slider with morphing indicator
TermosContinuousSlider
Continuous-value slider with floating label
TermosDetailedSlider
Major ticks + subdivision dots with snap and morph
TermosSwitch
Particle-style ON/OFF toggle
TermosTextField
Text input with dot-grid, edge glow, vertical starfield on focus
TermosTimePicker
Drum wheel picker with CRT band and scanlines
TermosCrt
CRT wrapper: scanlines, vignette, bezel
TermosLoadingIndicator
Small spinner or large comet orbit animation
TermosGroup
Dot-grid alignment group for coordinated mesh effects
Full constructor parameters for the widgets and painters used in example/lib/main.dart are listed under Gallery reference in the Example section.
Core
Component
Purpose
DotGridWidget
Layered dot mesh with ripple, hover, and programmatic triggers
DotGridController
Programmatic selection and trigger API for DotGridWidget
DotGridGroup
InheritedWidget for shared grid origin across widgets
TermosTapTarget
Dot-grid tap feedback (replaces Material ripple when heavy effects are on)
TermosAlignedBuilder
Provides offset relative to DotGridGroup for aligned painters
How decorations render
DotGridPainter is a CustomPainter that lays out dots on a regular rectangular lattice and draws the entire background grid in a single Canvas.drawRawPoints. Touch and selection decorations are not separate layers or shaders: for each dot inside the influence radius, per-dot color is computed via smoothstep radial falloff and merged with Color.lerp, then only the affected dots are overdrawn individually with Canvas.drawRect.
Each pointer gets its own AnimationController backed by the widget's TickerProvider. While the finger is down the animation value stays constant, producing a filled blob; on release a CurvedAnimation (Curves.easeOut) drives the value upward over decayDuration, expanding the blob into a ring that fades out. Each tick calls setState, which rebuilds the CustomPaint with updated touch data so only one painter handles both static and animated states.
Heavy effects toggle
Set TermosThemeData.heavyEffectsEnabled = false to disable dot-grid mesh, starfield particles, and CRT overlays. Widgets fall back to simpler Material-style visuals with the same layout and colors.
Accessibility
All interactive widgets expose Semantics for screen readers:
Buttons (TermosButton, TermosBackButton): button role with label
Toggle (TermosSwitch): toggled state
Navigation (TermosNavBar items): selected state and label
Segments (TermosSegmentedSelector): selected state and label
Sliders: slider role with current value
Time picker: labeled with current time value
Example
Run the widget gallery / theme configurator:
cd example
flutter run
Gallery reference
The example app demonstrates the widgets and painters below. Parameters are the public constructor fields (optional parameters show their defaults where the API defines them).
GIF previews below illustrate the widgets and painters that have gallery captures.
Grid alignment internals
DotGridGroup provides a shared grid origin so that multiple DotGridWidget and TermosAlignedBuilder instances line up their dot phase. Alignment is computed via context.findRenderObject() in post-frame callbacks — no GlobalKey instances are used.
Type
Notes
DotGridGroup
Passes its BuildContext to descendants via InheritedWidget; descendants use it to obtain the group's RenderBox for origin alignment.
DotGridWidget
Uses context.findRenderObject() for pointer coordinate mapping and grid offset computation.
TermosAlignedBuilder
Uses context.findRenderObject() to compute localToGlobal offset vs the nearest DotGridGroup.
TermosGroup is a thin wrapper around DotGridGroup (same behavior). Several themed widgets compose DotGridWidget and/or TermosAlignedBuilder (for example TermosTextField, TermosButton, TermosBackButton); the same considerations apply when debugging layout.
TermosTheme
Parameter
Type
Required
Description
key
Key?
Standard widget key.
data
TermosThemeData
✓
Theme tokens for descendants.
child
Widget
✓
Subtree that reads TermosTheme.of(context).
TermosThemeData (passed as TermosTheme.data)
Used throughout the example to configure colors, metrics, and effects. Constructor parameters:
Parameter
Type
Default
Description
colors
TermosColors
(required)
Semantic palette.
dotGrid
DotGridConfig
(required)
Dot geometry.
textStyles
TermosTextStyles
(required)
Typography.
metrics
TermosMetrics
TermosMetrics.standard
Layout radii, heights, durations, etc.
starfield
TermosStarfieldConfig
TermosStarfieldConfig()
Starfield tuning.
navBar
TermosNavBarEffects
TermosNavBarEffects()
Nav bar glow/starfield.
segmented
TermosSegmentedEffects
TermosSegmentedEffects()
Segmented control glow.
button
TermosButtonEffects
TermosButtonEffects()
Button border blends.
crt
TermosCrtEffects
TermosCrtEffects()
CRT bezel/shadows.
timePicker
TermosTimePickerEffects
TermosTimePickerEffects()
Time picker band/scanlines.
heavyEffectsEnabled
bool
true
When false, heavy dot grid/starfield/CRT are reduced.