copyWith method

Fraction copyWith({
  1. int? numerator,
  2. int? denominator,
})

Creates a deep copy of this object with the given fields replaced with the new values.

Implementation

Fraction copyWith({
  int? numerator,
  int? denominator,
}) {
  return Fraction(
    numerator ?? this.numerator,
    denominator ?? this.denominator,
  );
}