HeaderColumn.text constructor

HeaderColumn.text(
  1. String text, {
  2. String? textVisibilityDialog,
  3. TextStyle? style,
  4. TextAlign? textAlign,
  5. int? maxLines,
  6. TextOverflow? overflow,
  7. ColumnAutoSize? autoSize = const ColumnAutoSize(),
  8. double? autoSizeWidth,
  9. ColumnAutoSizeWidthBuilder? autoSizeWidthBuilder,
  10. double? width,
  11. double? minimumWidth,
  12. double? maximumWidth,
  13. double? flex,
  14. int height = 55,
  15. bool visible = true,
  16. bool resizable = true,
  17. int? combinedColumns,
  18. bool pinLeft = false,
  19. bool pinRight = false,
  20. bool canHide = true,
  21. bool sortable = false,
  22. bool filterable = false,
  23. TreeDataTableColumnFilterType filterType = TreeDataTableColumnFilterType.text,
  24. bool reorderable = true,
  25. 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',
      );