TreeRowNode.fromValues constructor

TreeRowNode.fromValues({
  1. Object? id,
  2. int? level,
  3. required List<Object?> values,
  4. List<TreeRowNode> rows = const [],
  5. bool? hasChildren,
  6. bool isExpanded = false,
  7. double height = 51,
  8. void onExpansionChanged(
    1. bool isExpanded
    )?,
  9. bool selectable = true,
  10. void onSelectedChanged(
    1. bool isExpanded
    )?,
  11. TreeDataTableRowCallback? onTap,
  12. TreeDataTableRowCallback? onDoubleTap,
  13. TreeDataTableRowCallback? onSecondaryTap,
})

Creates a text row from raw values.

Each value is rendered with toString(). The original value is also used for sorting and filtering, so numeric and date values can keep their natural ordering while still displaying as text.

Implementation

TreeRowNode.fromValues({
  this.id,
  this.level,
  required List<Object?> values,
  this.rows = const [],
  bool? hasChildren,
  this.isExpanded = false,
  this.height = 51,
  this.onExpansionChanged,
  this.selectable = true,
  this.onSelectedChanged,
  this.onTap,
  this.onDoubleTap,
  this.onSecondaryTap,
})  : columns = values.map((value) => TreeColumn.value(value)).toList(growable: false),
      hasChildren = hasChildren ?? rows.isNotEmpty,
      assert(values.isNotEmpty, 'Values must not be empty'),
      assert(height > 0, 'height must be greater than zero');