TreeColumn.value constructor

TreeColumn.value(
  1. Object? value, {
  2. String formatter(
    1. Object? value
    )?,
  3. TextStyle? style,
  4. TextAlign? textAlign,
  5. int? maxLines,
  6. TextOverflow? overflow,
  7. double? autoSizeWidth,
  8. ColumnAutoSizeWidthBuilder? autoSizeWidthBuilder,
  9. Object? sortValue,
  10. Object? filterValue,
  11. TreeDataTableCellCallback? onTap,
  12. TreeDataTableCellCallback? onDoubleTap,
  13. TreeDataTableCellCallback? onSecondaryTap,
  14. TreeDataTableCellCallback? onHover,
})

Creates a text cell from a raw value.

The displayed text defaults to value.toString(). The original value is also used as the default sortValue and filterValue, so formatted numbers, dates, and other comparable values can keep their natural sort and filter behavior.

Implementation

TreeColumn.value(
  Object? value, {
  String Function(Object? value)? formatter,
  TextStyle? style,
  TextAlign? textAlign,
  int? maxLines,
  TextOverflow? overflow,
  this.autoSizeWidth,
  this.autoSizeWidthBuilder,
  Object? sortValue,
  Object? filterValue,
  this.onTap,
  this.onDoubleTap,
  this.onSecondaryTap,
  this.onHover,
})  : widget = Text(
        formatter?.call(value) ?? value?.toString() ?? '',
        style: style,
        textAlign: textAlign,
        maxLines: maxLines,
        overflow: overflow,
      ),
      sortValue = sortValue ?? value,
      filterValue = filterValue ?? sortValue ?? value,
      assert(autoSizeWidth == null || (autoSizeWidth.isFinite && autoSizeWidth >= 0));