copyWith method Null safety

BorderRadius copyWith(
  1. {Radius? topLeft,
  2. Radius? topRight,
  3. Radius? bottomLeft,
  4. Radius? bottomRight}
)

Returns a copy of this BorderRadius with the given fields replaced with the new values.

Implementation

BorderRadius copyWith({
  Radius? topLeft,
  Radius? topRight,
  Radius? bottomLeft,
  Radius? bottomRight,
}) {
  return BorderRadius.only(
    topLeft: topLeft ?? this.topLeft,
    topRight: topRight ?? this.topRight,
    bottomLeft: bottomLeft ?? this.bottomLeft,
    bottomRight: bottomRight ?? this.bottomRight,
  );
}