copyWith method

StarRatingTheme copyWith({
  1. ValueGetter<Color?>? activeColor,
  2. ValueGetter<Color?>? backgroundColor,
  3. ValueGetter<double?>? starSize,
  4. ValueGetter<double?>? starSpacing,
})

Returns a copy of this theme with the given fields replaced.

Implementation

StarRatingTheme copyWith({
  ValueGetter<Color?>? activeColor,
  ValueGetter<Color?>? backgroundColor,
  ValueGetter<double?>? starSize,
  ValueGetter<double?>? starSpacing,
}) {
  return StarRatingTheme(
    activeColor: activeColor == null ? this.activeColor : activeColor(),
    backgroundColor:
        backgroundColor == null ? this.backgroundColor : backgroundColor(),
    starSize: starSize == null ? this.starSize : starSize(),
    starSpacing: starSpacing == null ? this.starSpacing : starSpacing(),
  );
}