copyWith method

LottoStyle copyWith({
  1. Color? drumColor,
  2. Color? rimColor,
  3. Color? slotColor,
  4. Color? buttonColor,
  5. Color? buttonTextColor,
  6. String? buttonText,
})

返回替换非空参数的副本,例如 style.copyWith(buttonText: '开奖')。

Implementation

LottoStyle copyWith(
        {Color? drumColor,
        Color? rimColor,
        Color? slotColor,
        Color? buttonColor,
        Color? buttonTextColor,
        String? buttonText}) =>
    LottoStyle(
        drumColor: drumColor ?? this.drumColor,
        rimColor: rimColor ?? this.rimColor,
        slotColor: slotColor ?? this.slotColor,
        buttonColor: buttonColor ?? this.buttonColor,
        buttonTextColor: buttonTextColor ?? this.buttonTextColor,
        buttonText: buttonText ?? this.buttonText);