EtherAmount.fromBase10String constructor

EtherAmount.fromBase10String(
  1. EtherUnit unit,
  2. String amount
)

Constructs an amount of Ether by a unit and its amount.

Implementation

factory EtherAmount.fromBase10String(EtherUnit unit, String amount) {
  final wei = _factors[unit]! * BigInt.parse(amount);

  return EtherAmount.inWei(wei);
}