t×tecexpressby TeKOcloud
DEv0.7.1
API & types / FLUTTER

TxThemeData.

Semantic colors and dimensions as a ThemeExtension. copyWith replaces individual tokens; lerp interpolates between themes.

TxThemeData

ParameterTypeDefaultMeaning
backgroundColorrequiredBackground color.
surfaceColorrequiredPrimary surface color.
surfaceAltColorrequiredAlternate surface color.
textColorrequiredText to display.
mutedColorrequiredSecondary text color.
borderColorrequiredBorder color.
accentColorrequiredAccent color.
onAccentColorrequiredText color on accent surfaces.
hoverColorrequiredHover background.
selectionColorrequiredSelection mode.
dangerColorrequiredError color.
successColorrequiredSuccess color.
focusColorrequiredFocus color.
radiusdouble8Corner radius in logical pixels.
spacingdouble8Base spacing in logical pixels.
controlHeightdouble40Base input height in logical pixels.
Member / type / returnMeaning
static const TxThemeData light = TxThemeData(background: Color(0xfff3f5fa), surface: Colors.white, surfaceAlt: Color(0xfff7f9fc), text: Color(0xff172339), muted: Color(0xff53627a), border: Color(0xffc7d0df), accent: Color(0xff365bc6), onAccent: Colors.white, hover: Color(0xffe9eefb), selection: Color(0xffe1eaff), danger: Color(0xffb42338), success: Color(0xff137553), focus: Color(0xff315dd6))Default light tokens or light Material theme.
static const TxThemeData dark = TxThemeData(background: Color(0xff101725), surface: Color(0xff182236), surfaceAlt: Color(0xff1d2a40), text: Color(0xffedf2fc), muted: Color(0xffb0bfd6), border: Color(0xff465974), accent: Color(0xffa9beff), onAccent: Color(0xff132348), hover: Color(0xff283c5c), selection: Color(0xff2b416b), danger: Color(0xffff9cad), success: Color(0xff7bdbb4), focus: Color(0xffb5c8ff))Default dark tokens or dark Material theme.
TxThemeData copyWith({Color? background, Color? surface, Color? surfaceAlt, Color? text, Color? muted, Color? border, Color? accent, Color? onAccent, Color? hover, Color? selection, Color? danger, Color? success, Color? focus, double? radius, double? spacing, double? controlHeight})Creates a copy with the supplied changes; preserves other values.
TxThemeData lerp(covariant TxThemeData? other, double t)Interpolates tokens toward another theme by factor t; null preserves this theme.
dart
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';

Future<void> example() async {
  final tokens = TxThemeData.light.copyWith(accent: Colors.indigo, radius: 12);
  print(tokens.lerp(TxThemeData.dark, 0.5).accent);
}