TreeViewItem constructor

TreeViewItem({
  1. Key? key,
  2. Widget? leading,
  3. required Widget content,
  4. dynamic value,
  5. List<TreeViewItem> children = const [],
  6. bool collapsable = true,
  7. bool? expanded,
  8. bool? selected = false,
  9. TreeViewItemInvoked? onInvoked,
  10. TreeViewItemOnExpandToggle? onExpandToggle,
  11. Map<Type, GestureRecognizerFactory<GestureRecognizer>> gestures = const {},
  12. ButtonState<Color>? backgroundColor,
  13. bool autofocus = false,
  14. FocusNode? focusNode,
  15. String? semanticLabel,
  16. Widget? loadingWidget,
  17. bool lazy = false,
})

Creates a tree view item.

Implementation

TreeViewItem({
  this.key,
  this.leading,
  required this.content,
  this.value,
  this.children = const [],
  this.collapsable = true,
  bool? expanded,
  this.selected = false,
  this.onInvoked,
  this.onExpandToggle,
  this.gestures = const {},
  this.backgroundColor,
  this.autofocus = false,
  FocusNode? focusNode,
  this.semanticLabel,
  this.loadingWidget,
  this.lazy = false,
})  : expanded = expanded ?? children.isNotEmpty,
      _anyExpandableSiblings = false,
      focusNode = focusNode ?? FocusNode();