plinth_core library
Design tokens and theme foundation for Plinth UI.
Classes
- PlinthSchemeDisagreement
-
One field where a
ColorSchemeand a PlinthTheme disagree about what colour something is. - PlinthSemanticColor
- A colour named by the role it plays, rather than by its hue.
- PlinthSeriesColor
- One entry in a categorical sequence: a ramp, and the shade to take from it.
- PlinthSpacing
- The spacing scale as compile-time constants.
- PlinthTheme
- The design-token layer for Plinth. Every Plinth widget reads its colors, spacing, radius, and font sizes from an instance of this class rather than hardcoding values, so a single theme swap restyles the whole app.
Enums
- PlinthContrast
- The contrast floor a colour has to clear, by what it is being used for. WCAG 2.x gives three, and picking between them is a decision about the content — not something a caller should have to remember as a bare number.
- PlinthDensity
- How much room interactive controls are given, as a minimum tap target.
- PlinthRole
- The colour roles the component library itself needs, independent of which ramp answers them.
- PlinthSize
- The Plinth size scale, used across nearly every component (buttons, inputs, badges, etc.) so sizing stays consistent throughout an app.
- PlinthVariant
- The Plinth visual variant scale, mirroring Mantine's approach: each component interprets these consistently so switching a component's "loudness" is a one-line change.
Extensions
- PlinthMaterialBridge on PlinthTheme
-
Reconciling a PlinthTheme with Material's
ThemeData. - PlinthThemeContext on BuildContext
-
Convenience accessor:
context.plinth. - PlinthThemeData on ThemeData
- The same lookup for code that already holds a ThemeData.
Constants
- kDarkBorder → const Color
- kDarkBorderMuted → const Color
- kDarkSurface → const Color
-
The same set for the dark theme, using Mantine's
darkramp. - kDarkSurfaceMuted → const Color
- kDarkSurfaceSunken → const Color
- kDarkText → const Color
- kDarkTextDisabled → const Color
- kDarkTextMuted → const Color
-
kDefaultFontSizes
→ const Map<
PlinthSize, double> - Default font size scale (in logical pixels).
-
kDefaultRadius
→ const Map<
PlinthSize, double> - Default corner radius scale (in logical pixels).
-
kDefaultRoleRamps
→ const Map<
PlinthRole, String> - Which ramp answers each of the component library's own roles.
-
kDefaultSeriesColors
→ const List<
PlinthSeriesColor> - The default categorical sequence — chosen to survive colour-vision deficiency, not just to look well separated.
-
kDefaultSpacing
→ const Map<
PlinthSize, double> - Default spacing scale (in logical pixels), matching Mantine's defaults.
- kLightBorder → const Color
- kLightBorderMuted → const Color
- kLightSurface → const Color
- Surface, text, and border colors for the light theme.
- kLightSurfaceMuted → const Color
- kLightSurfaceSunken → const Color
- kLightText → const Color
- kLightTextDisabled → const Color
- kLightTextMuted → const Color
- kSpaceUnit → const double
- The base spacing unit. Every step on the spacing scale, and every ad-hoc gap a caller needs, should be a whole multiple of this.
-
kVividSeriesColors
→ const List<
PlinthSeriesColor> - The hue-optimised sequence: maximum separation for normal colour vision only.
Typedefs
-
PlinthColorShades
= List<
Color> - A shade ramp for a single color, indexed 0 (lightest) to 9 (darkest), matching Mantine's 10-shade convention.