HeaderColumn.text constructor
HeaderColumn.text(
- String text, {
- String? textVisibilityDialog,
- TextStyle? style,
- TextAlign? textAlign,
- int? maxLines,
- TextOverflow? overflow,
- ColumnAutoSize? autoSize = const ColumnAutoSize(),
- double? autoSizeWidth,
- ColumnAutoSizeWidthBuilder? autoSizeWidthBuilder,
- double? width,
- double? minimumWidth,
- double? maximumWidth,
- double? flex,
- int height = 55,
- bool visible = true,
- bool resizable = true,
- int? combinedColumns,
- bool pinLeft = false,
- bool pinRight = false,
- bool canHide = true,
- bool sortable = false,
- bool filterable = false,
- TreeDataTableColumnFilterType filterType = TreeDataTableColumnFilterType.text,
- bool reorderable = true,
- TreeDataTableSortComparator? sortComparator,
Creates a text header column.
This is a convenience constructor for the common case where the header
label and the column-visibility label are the same text. Override
textVisibilityDialog when the visible header needs shorter wording.
Implementation
HeaderColumn.text(
String text, {
String? textVisibilityDialog,
TextStyle? style,
TextAlign? textAlign,
int? maxLines,
TextOverflow? overflow,
this.autoSize = const ColumnAutoSize(),
this.autoSizeWidth,
this.autoSizeWidthBuilder,
this.width,
this.minimumWidth,
this.maximumWidth,
this.flex,
this.height = 55,
this.visible = true,
this.resizable = true,
this.combinedColumns,
this.pinLeft = false,
this.pinRight = false,
this.canHide = true,
this.sortable = false,
this.filterable = false,
this.filterType = TreeDataTableColumnFilterType.text,
this.reorderable = true,
this.sortComparator,
}) : widget = Text(
text,
style: style,
textAlign: textAlign,
maxLines: maxLines,
overflow: overflow,
),
textVisibilityDialog = textVisibilityDialog ?? text,
assert(!(pinLeft && pinRight), 'pinLeft and pinRight cannot both be true'),
assert(autoSizeWidth == null || (autoSizeWidth.isFinite && autoSizeWidth >= 0)),
assert(width == null || (width.isFinite && width > 0), 'width must be finite and greater than zero'),
assert(flex == null || (flex.isFinite && flex > 0), 'flex must be finite and greater than zero'),
assert(minimumWidth == null || (minimumWidth.isFinite && minimumWidth >= 0),
'minimumWidth must be finite and non-negative'),
assert(maximumWidth == null || (!maximumWidth.isNaN && maximumWidth > 0),
'maximumWidth must be greater than zero'),
assert(height > 0, 'height must be greater than zero'),
assert(combinedColumns == null || combinedColumns > 0, 'combinedColumns must be greater than zero'),
assert(width == null || minimumWidth == null || width >= minimumWidth,
'width cannot be smaller than minimumWidth'),
assert(
width == null || maximumWidth == null || width <= maximumWidth,
'width cannot be greater than maximumWidth',
),
assert(
minimumWidth == null || maximumWidth == null || maximumWidth >= minimumWidth,
'maximumWidth cannot be smaller than minimumWidth',
),
assert(
width != null || flex != null,
'Either width or flex must be provided',
);