Fixed.copyWith constructor

Fixed.copyWith(
  1. Fixed fixed, {
  2. int? scale,
})

Returns a new Fixed value from an existing one changing the scale to scale.

Implementation

factory Fixed.copyWith(Fixed fixed, {int? scale}) {
  scale ??= fixed.scale;
  _checkScale(scale);
  return Fixed.fromBigInt(
      _rescale(fixed.minorUnits,
          existingScale: fixed.scale, targetScale: scale),
      scale: scale);
}