TreeRowNode.fromCells constructor
TreeRowNode.fromCells({
- Object? id,
- int? level,
- required List<
Widget> cells, - List<
TreeRowNode> rows = const [], - bool? hasChildren,
- bool isExpanded = false,
- double height = 51,
- void onExpansionChanged(
- bool isExpanded
- bool selectable = true,
- void onSelectedChanged(
- bool isExpanded
- TreeDataTableRowCallback? onTap,
- TreeDataTableRowCallback? onDoubleTap,
- 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');