DashboardCardStyle class
Shared "card chrome" for the dashboard stat card kit — background, border, corner radius, padding, and text styles.
This governs the container around a gauge, not the gauge canvas itself (see GaugeStyle/GaugeTokens for that). The defaults match a dark "smart car dashboard" aesthetic: a near-black glass card with a faint white edge.
For a light theme, prefer the DashboardCardStyle.light constructor over hand-overriding fields — it sets a coherent set of light-appropriate colours (including trackColor, which is easy to forget and renders the gauge's empty track invisible against a white card if left dark-tuned):
// Light cabin / rental-booking theme:
const style = DashboardCardStyle.light();
// The dark default is also available by name for symmetry:
const style = DashboardCardStyle.dark();
// Either constructor still takes per-field overrides:
const branded = DashboardCardStyle.light(cornerRadius: 12);
Constructors
- DashboardCardStyle({Color backgroundColor = const Color(0xFF12151C), Color borderColor = const Color(0x14FFFFFF), double borderWidth = 1.0, double cornerRadius = 24.0, EdgeInsetsGeometry padding = const EdgeInsets.all(16), TextStyle labelStyle = const TextStyle(color: Color(0xFF8A8F98), fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: 1.0), TextStyle valueStyle = const TextStyle(color: Colors.white, fontSize: 30, fontWeight: FontWeight.w700, height: 1.0), TextStyle unitStyle = const TextStyle(color: Color(0xFF8A8F98), fontSize: 12, fontWeight: FontWeight.w600), double glowOpacity = 0.35, Color trackColor = const Color(0x14FFFFFF)})
-
The default (dark) card chrome — a near-black glass card with a faint
white edge. Every field is overridable.
const
- DashboardCardStyle.dark()
-
A dark card chrome — a named alias for the default unnamed constructor,
provided for symmetry with DashboardCardStyle.light so the theme
choice reads explicitly at the call site.
const
- DashboardCardStyle.light({Color backgroundColor = Colors.white, Color borderColor = const Color(0x14000000), double borderWidth = 1.0, double cornerRadius = 24.0, EdgeInsetsGeometry padding = const EdgeInsets.all(16), TextStyle labelStyle = const TextStyle(color: Color(0xFF64748B), fontSize: 11, fontWeight: FontWeight.w600, letterSpacing: 1.0), TextStyle valueStyle = const TextStyle(color: Color(0xFF0F172A), fontSize: 30, fontWeight: FontWeight.w700, height: 1.0), TextStyle unitStyle = const TextStyle(color: Color(0xFF64748B), fontSize: 12, fontWeight: FontWeight.w600), double glowOpacity = 0.12, Color trackColor = const Color(0x14000000)})
-
A light card chrome — a white card with a faint dark edge, slate text,
and a subtle glow, for a sun-visor display or a rental-booking screen.
const
Properties
- backgroundColor → Color
-
Card fill colour.
final
- borderColor → Color
-
Card edge colour — a faint stroke that reads as "glass" on a dark
background.
final
- borderWidth → double
-
Card edge stroke width.
final
- cornerRadius → double
-
Card corner radius.
final
- glowOpacity → double
-
Opacity of the accent-coloured glow cast behind a card when its
showGlowistrue.0disables the glow shadow.final - hashCode → int
-
The hash code for this object.
no setterinherited
- labelStyle → TextStyle
-
Text style for the small uppercase label in the card header.
final
- padding → EdgeInsetsGeometry
-
Inner padding between the card edge and its content.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trackColor → Color
-
Colour of the unfilled portion of a ring or bar gauge inside the
card. The default (a faint white wash) reads as "empty track" on the
dark backgroundColor default. For a light theme, prefer the
DashboardCardStyle.light constructor, which flips this to a dark wash
(
Color(0x14000000)) for you — otherwise the track becomes invisible against a white card.final - unitStyle → TextStyle
-
Text style for the unit suffix beside the value numeral.
final
- valueStyle → TextStyle
-
Text style for the large primary value numeral.
final
Methods
-
copyWith(
{Color? backgroundColor, Color? borderColor, double? borderWidth, double? cornerRadius, EdgeInsetsGeometry? padding, TextStyle? labelStyle, TextStyle? valueStyle, TextStyle? unitStyle, double? glowOpacity, Color? trackColor}) → DashboardCardStyle - Returns a copy with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited