TKeyValueTheme class
Theme configuration for TKeyValueSection.
TKeyValueTheme controls the appearance of key-value pairs, including:
- Text styles for keys, labels, and values
- Grid layout spacing and breakpoints
- Implementers
Constructors
- TKeyValueTheme({required TextStyle keyStyle, required TextStyle labelStyle, required TextStyle valueStyle, double gridHorizontalSpacing = 0, double gridVerticalSpacing = 8, double minGridColWidth = 110, bool forceKeyValue = false, double keyValueBreakPoint = 300, required Color borderColor, bool showLeftBorder = false, Alignment alignment = Alignment.topLeft, EdgeInsets narrowPadding = const EdgeInsets.symmetric(vertical: 6), double narrowItemBottomSpacing = 10, int narrowKeyFlex = 2, int narrowValueFlex = 3, double narrowGap = 12, EdgeInsets gridCellPadding = const EdgeInsets.symmetric(horizontal: 6, vertical: 6), double gridCellGap = 4, double maxColWidthFraction = 0.7, double minFractionFixed = 1.0, double minFractionStructured = 0.9, double minFractionCompact = 0.80, double minFractionProse = 0.70, double additionalNaturalWidth = 15, int maxItemsPerRow = 12, bool gridInline = false, bool columnar = false, int? columns, double? inlineKeyWidth, double? inlineKeyMaxWidth, double inlineKeyGap = 8, Alignment? inlineKeyAlignment = Alignment.topLeft})
-
Creates a key-value theme.
const
- TKeyValueTheme.defaultTheme(ColorScheme colors)
-
factory
Properties
- additionalNaturalWidth → double
-
Extra width added to the calculated natural width of each child.
final
- alignment → Alignment
-
Default alignment for key-value content.
final
- borderColor → Color
-
final
- columnar → bool
-
Whether to arrange items in a columnar grid.
When true (or when columns is set), items are arranged in uniform columns with aligned keys.
When false (default), items flow dynamically into rows based on natural widths.
final
- columns → int?
-
Fixed number of columns for grid layout.
When specified, items are distributed into a columnar grid of this width.
final
- forceKeyValue → bool
-
Whether to force the key-value (narrow) layout regardless of screen width.
final
- gridCellGap → double
-
Vertical spacing between the label and value within a grid cell.
final
- gridCellPadding → EdgeInsets
-
Padding surrounding each individual cell in grid layout.
final
- gridHorizontalSpacing → double
-
Horizontal spacing between cells/columns in grid layout.
final
- gridInline → bool
-
Whether to display key and value inline in grid layout (Key: Value).
final
- gridVerticalSpacing → double
-
Vertical spacing between rows in grid layout.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inlineKeyAlignment → Alignment?
-
Alignment of the key within its column in inline grid layout.
final
- inlineKeyGap → double
-
Horizontal gap between the key and value in inline grid layout.
final
- inlineKeyMaxWidth → double?
-
Maximum width allowed for key columns in inline grid layout.
final
- inlineKeyWidth → double?
-
Fixed width for key columns in inline grid layout.
final
- keyStyle → TextStyle
-
The style for keys/labels in key-value (narrow) layout.
final
- keyValueBreakPoint → double
-
The screen width threshold under which the key-value layout is used.
final
- labelStyle → TextStyle
-
The style for keys/labels in grid (wide) layout.
final
- maxColWidthFraction → double
-
The maximum fraction of total layout width a single column can consume.
final
- maxItemsPerRow → int
-
The maximum number of items allowed per row in grid layout.
final
- minFractionCompact → double
-
Minimum fraction of natural width tolerated by
compactcontent priority.final - minFractionFixed → double
-
Minimum fraction of natural width tolerated by
fixedcontent priority.final - minFractionProse → double
-
Minimum fraction of natural width tolerated by
prosecontent priority.final - minFractionStructured → double
-
Minimum fraction of natural width tolerated by
structuredcontent priority.final - minGridColWidth → double
-
The minimum allowed width for columns in grid layout.
final
- narrowGap → double
-
Horizontal gap between the key and value columns in narrow key-value layout.
final
- narrowItemBottomSpacing → double
-
Vertical spacing between items in narrow key-value layout.
final
- narrowKeyFlex → int
-
Flex factor for the key column in narrow key-value layout.
final
- narrowPadding → EdgeInsets
-
Overall padding surrounding the narrow key-value layout container.
final
- narrowValueFlex → int
-
Flex factor for the value column in narrow key-value layout.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showLeftBorder → bool
-
Whether to show a left vertical border/separator on grid cells.
final
- valueStyle → TextStyle
-
The style for text values.
final
Methods
-
copyWith(
{TextStyle? keyStyle, TextStyle? labelStyle, TextStyle? valueStyle, double? gridHorizontalSpacing, double? gridVerticalSpacing, double? minGridColWidth, bool? forceKeyValue, double? keyValueBreakPoint, Color? borderColor, bool? showLeftBorder, Alignment? alignment, EdgeInsets? narrowPadding, double? narrowItemBottomSpacing, int? narrowKeyFlex, int? narrowValueFlex, double? narrowGap, EdgeInsets? gridCellPadding, double? gridCellGap, double? maxColWidthFraction, double? minFractionFixed, double? minFractionStructured, double? minFractionCompact, double? minFractionProse, double? additionalNaturalWidth, int? maxItemsPerRow, bool? gridInline, bool? columnar, int? columns, double? inlineKeyWidth, double? inlineKeyMaxWidth, double? inlineKeyGap, Alignment? inlineKeyAlignment}) → TKeyValueTheme -
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