PolyAmount.fromUnitAndValue constructor

PolyAmount.fromUnitAndValue(
  1. PolyUnit unit,
  2. dynamic amount
)

Constructs an amount of Poly by a unit and its amount. amount can either be a base10 string, an int, or any numerical value.

Implementation

factory PolyAmount.fromUnitAndValue(PolyUnit unit, dynamic amount) {
  return PolyAmount.inNanopoly(
      quantity: parseValue(amount) * _factors[unit]!);
}