copyWith method
Inheritable<T>
copyWith({
- Key? key,
- T? value,
- Set<
AspectOverride< ? overrides,Object, T> > - Widget? child,
Create a new Inheritable of T
with it's properties changed with the
supplied values
Returns this
if all parameters are null.
Implementation
Inheritable<T> copyWith({
Key? key,
T? value,
Set<AspectOverride<Object, T>>? overrides,
Widget? child,
}) {
if ([key, value, overrides, child].whereType<Object>().isEmpty) return this;
return Inheritable<T>._(
key: key ?? this.key,
value: value ?? _value,
overrides: overrides != null ? newOverridesSet(overrides) : _overrides,
child: child ?? this.child,
);
}