copyWith method

WheelStyle copyWith({
  1. LuckyFill? background,
  2. LuckyTextDefaults? text,
  3. bool clearBackground = false,
})

替换非 null 字段;clearBackground 显式清除背景。

Implementation

WheelStyle copyWith(
        {LuckyFill? background,
        LuckyTextDefaults? text,
        bool clearBackground = false}) =>
    WheelStyle(
        background: clearBackground ? null : background ?? this.background,
        text: text ?? this.text);