copyWith static method

Widget copyWith({
  1. Key? key,
  2. required Widget child,
  3. TextStyle? textStyle,
  4. Color? color,
  5. Color? hoverColor,
  6. Color? highlightColor,
})

Makes a copy of the nearest TreeTheme overwriting selected fields.

Implementation

static Widget copyWith({
  Key? key,
  required Widget child,
  TextStyle? textStyle,
  Color? color,
  Color? hoverColor,
  Color? highlightColor,
}) {
  return Builder(
    key: key,
    builder: (context) => TreeTheme(
      data: TreeTheme.of(context).copyWith(
        textStyle: textStyle,
        color: color,
        hoverColor: hoverColor,
        highlightColor: highlightColor,
      ),
      child: child,
    ),
  );
}