copyWith method

Creates a copy of this wrapped icon with modified icon theme data.

Parameters:

  • data (WrappedIconDataBuilder<IconThemeData>?, optional): New icon theme data builder.

Returns: A new WrappedIcon with merged theme data.

Implementation

WrappedIcon copyWith({
  WrappedIconDataBuilder<IconThemeData>? data,
}) {
  return WrappedIcon(
    data: (context, theme) {
      return data?.call(context, theme).merge(this.data(context, theme)) ??
          this.data(context, theme);
    },
    child: child,
  );
}