EtherAmount.fromInt constructor

EtherAmount.fromInt(
  1. EtherUnit unit,
  2. int amount
)

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

Implementation

factory EtherAmount.fromInt(EtherUnit unit, int amount) {
  final wei = _factors[unit]! * BigInt.from(amount);

  return EtherAmount.inWei(wei);
}