TreeRowNode.fromCells constructor

TreeRowNode.fromCells({
  1. Object? id,
  2. int? level,
  3. required List<Widget> cells,
  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 row from cell widgets.

Use this when the cells do not need custom TreeColumn metadata. Switch to TreeColumn.custom for per-cell sorting, filtering, sizing, or interaction callbacks.

Implementation

TreeRowNode.fromCells({
  this.id,
  this.level,
  required List<Widget> cells,
  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 = cells.map((cell) => TreeColumn.custom(widget: cell)).toList(growable: false),
      hasChildren = hasChildren ?? rows.isNotEmpty,
      assert(cells.isNotEmpty, 'Cells must not be empty'),
      assert(height > 0, 'height must be greater than zero');