Decimal constructor
Implementation
Decimal({required this.precision, int? intValue, double? doubleValue})
: assert(precision >= 0, 'precision must be positive or zero'),
assert(
intValue == null || doubleValue == null,
'intValue or doubleValue must be null',
),
_doubleValue =
double.tryParse(doubleValue?.toStringAsFixed(precision) ?? '') ??
(intValue ?? 0).toDouble() / pow(10, precision);