TTableHeader<T, K> class
Defines a column in TTable.
TTableHeader configures how a column renders, including:
- Header text and alignment
- Data mapping from item T
- Custom cell builders
- Column sizing (flex, min/max width)
- Specialized types (image, chip, actions, editable)
Basic Usage
TTableHeader(text: 'Name', map: (user) => user.name)
Specialized Constructors
- TTableHeader.image: Renders an image from URL
- TTableHeader.chip: Renders a TChip
- TTableHeader.actions: Renders action buttons
- TTableHeader.editable: Renders editable text
- TTableHeader.textField: Renders a text input
- TTableHeader.numberField: Renders a number input
Constructors
-
TTableHeader(String text, {Object? map(T)?, Widget builder(BuildContext, TListItem<
T, K> , int)?, int? flex, double? minWidth, double? maxWidth, Alignment? alignment}) -
Creates a standard table header.
const
-
TTableHeader.actions(List<
TButtonGroupItem> builder(TListItem<T, K> ), {String text = "Actions", Alignment? alignment = Alignment.center, int? flex, double? minWidth, double? maxWidth, int? count}) - Creates a header for row actions.
- TTableHeader.chip(String text, Object? map(T)?, {int? flex, double? minWidth, double? maxWidth, Alignment? alignment, Color? color, TVariant? type})
- Creates a header for displaying chips.
- TTableHeader.editable(String text, {required Object? get(T), required Widget builder(BuildContext ctx, T data), int? flex, double? minWidth = 150, double? maxWidth, Alignment? alignment})
- Creates an editable cell header.
- TTableHeader.image(String text, String? map(T), {int? flex, Alignment? alignment, double width = 50})
- Creates a header for displaying images.
- TTableHeader.map(String text, Object? map(T)?, {int? flex, double? minWidth, double? maxWidth, Alignment? alignment})
-
Creates a header using only a mapping function.
const
- TTableHeader.numberField(String text, num? get(T), void set(T, num?))
- Creates an editable number field header.
- TTableHeader.textField(String text, String? get(T), void set(T, String?))
- Creates an editable text field header.
Properties
- alignment → Alignment?
-
Alignment of content within the cell.
final
-
builder
→ Widget Function(BuildContext, TListItem<
T, K> , int)? -
Custom builder for cell content.
final
- flex → int?
-
Flex factor for column width.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- map → Object? Function(T)?
-
Function to extract cell value from item.
final
- maxWidth → double?
-
Maximum width of the column.
final
- minWidth → double?
-
Minimum width of the column.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
The header label text.
final
Methods
-
getTextAlign(
) → TextAlign - Gets the text alignment based on alignment.
-
getValue(
T item) → String - Gets the string display value for an item.
-
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