copyWith method Null safety

AdRatingBarView copyWith(
  1. AdView? view
)
override

Copy this with a new AdRatingBarView

Implementation

AdRatingBarView copyWith(AdView? view) {
  if (view == null) return this;
  assert(view is AdRatingBarView);
  return AdRatingBarView(
    decoration: view.decoration ?? decoration,
    height: view.height ?? height,
    width: view.width ?? width,
    margin: view.margin ?? margin,
    padding: view.padding ?? padding,
    elevation: view.elevation ?? elevation,
    elevationColor: view.elevationColor ?? elevationColor,
    stepSize: (view as AdRatingBarView).stepSize,
    starsColor: view.starsColor ?? starsColor,
  );
}