TKeyValue class
Represents a single key-value item in a TKeyValueSection.
Constructors
- TKeyValue(String key, {String? value, Widget? widget, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
- Creates a key-value item.
- TKeyValue.chip(String key, String? text, {dynamic chipIcon, Color? color, Color? background, Color? textColor, TVariant? type, TSize size = TChipSize.sm, VoidCallback? onTap, Widget? trailing, BorderRadius? chipBorderRadius, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying a chip using TChip.
factory
- TKeyValue.chips(String key, List items, {Color? color, Color? colorBuilder(String chipText)?, dynamic chipIcon, dynamic iconBuilder(String chipText)?, TVariant? type, TVariant? typeBuilder(String chipText)?, TSize size = TChipSize.sm, double spacing = 4.0, double runSpacing = 4.0, WrapCrossAlignment crossAxisAlignment = WrapCrossAlignment.center, WrapAlignment wrapAlignment = WrapAlignment.start, void onTap(String chipText)?, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying multiple chips in a Wrap.
factory
- TKeyValue.color(String key, String? hex, {Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying a color hex code using TColor.
factory
- TKeyValue.datetime(String key, dynamic value, {bool utc = true, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying a formatted date/time using TDateTimeText.
factory
- TKeyValue.image(String key, String? url, {Uint8List? bytes, double size = 40.0, double? imageWidth, double? imageHeight, BoxFit fit = BoxFit.cover, BorderRadius? borderRadius, bool forceCache = false, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying an image using TImage.
factory
- TKeyValue.progress(String key, double? value, {double progressMaxWidth = 180.0, double height = 6.0, bool showPercentage = true, String? valueText, TProgressValuePosition valuePosition = TProgressValuePosition.topRight, Color? color, Color? colorBuilder(double value, double percentage)?, Color? backgroundColor, bool flowing = false, TextStyle? valueStyle, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item for displaying progress bars using TProgressBar.
factory
-
TKeyValue.rating(String key, double? rating, {int itemCount = 5, double itemSize = 14.0, Color? color, Color? unratedColor, bool allowHalfRating = true, double spacing = 2.0, bool disabled = true, ValueChanged<
double?> ? onValueChanged, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth}) -
Creates a key-value item for displaying star ratings using TRating.
factory
- TKeyValue.text(String key, String? value, {Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth})
-
Creates a key-value item with text value.
factory
-
TKeyValue.toggle(String key, bool? value, {ValueChanged<
bool?> ? onValueChanged, bool disabled = false, TInputSize size = TInputSize.sm, Color? color, Color? inactiveColor, Widget? icon, double? width, Alignment? alignment, double? minWidth, double? maxWidth}) -
Creates a key-value item for displaying and editing boolean values using TSwitch.
factory
Properties
- alignment → Alignment?
-
Optional alignment for the item.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
Optional icon to display before the key.
final
- isEmptyValue → bool
-
Whether this item has no value to show: no widget and a null or blank
value. Values like
0,-orn/aare real values and are kept.no setter - key → String
-
The label/key text.
final
- maxWidth → double?
-
Optional maximum width for the item.
final
- minWidth → double?
-
Optional minimum width for the item.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → String?
-
The value text.
final
- widget → Widget?
-
Custom widget to display instead of text value.
final
- width → double?
-
Optional fixed width for the column.
final
Methods
-
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
Static Methods
-
mapHeaders<
T, K> (BuildContext ctx, List< TTableHeader< headers, TListItem<T, K> >T, K> item, int index) → List<TKeyValue> - Maps table headers to key-value items for list view representation.