NodeWidgetLeadingIcon constructor

const NodeWidgetLeadingIcon({
  1. Key? key,
  2. Widget? expandIcon,
  3. Widget? collapseIcon,
  4. Widget leafIcon = const Icon(Icons.article_rounded),
  5. EdgeInsetsGeometry padding = const EdgeInsets.all(8.0),
  6. bool useFoldersOnly = false,
  7. Color? leafIconDisabledColor,
  8. double? splashRadius,
  9. VoidCallback? onPressed,
})

Creates a NodeWidgetLeadingIcon.

If you're using custom icons for expandIcon or collapseIcon, make sure to give them Keys so that flutter animates the swap correctly.

Take a look at NodeWidgetLeadingIcon.kExpandIconKey and NodeWidgetLeadingIcon.kCollapseIconKey.

The leafIcon don't need a key as it doesn't get animated.

Implementation

const NodeWidgetLeadingIcon({
  Key? key,
  this.expandIcon,
  this.collapseIcon,
  this.leafIcon = const Icon(Icons.article_rounded),
  this.padding = const EdgeInsets.all(8.0),
  this.useFoldersOnly = false,
  this.leafIconDisabledColor,
  this.splashRadius,
  this.onPressed,
}) : super(key: key);