copyWith method
SwitchTheme
copyWith({
- ValueGetter<
Color?> ? activeColor, - ValueGetter<
Color?> ? inactiveColor, - ValueGetter<
Color?> ? activeThumbColor, - ValueGetter<
Color?> ? inactiveThumbColor, - ValueGetter<
double?> ? gap, - ValueGetter<
BorderRadiusGeometry?> ? borderRadius,
Returns a copy of this theme with the given fields replaced.
Implementation
SwitchTheme copyWith({
ValueGetter<Color?>? activeColor,
ValueGetter<Color?>? inactiveColor,
ValueGetter<Color?>? activeThumbColor,
ValueGetter<Color?>? inactiveThumbColor,
ValueGetter<double?>? gap,
ValueGetter<BorderRadiusGeometry?>? borderRadius,
}) {
return SwitchTheme(
activeColor: activeColor == null ? this.activeColor : activeColor(),
inactiveColor:
inactiveColor == null ? this.inactiveColor : inactiveColor(),
activeThumbColor:
activeThumbColor == null ? this.activeThumbColor : activeThumbColor(),
inactiveThumbColor: inactiveThumbColor == null
? this.inactiveThumbColor
: inactiveThumbColor(),
gap: gap == null ? this.gap : gap(),
borderRadius: borderRadius == null ? this.borderRadius : borderRadius(),
);
}