amountOf method

String amountOf(
  1. String? amount,
  2. String? currency
)

A payment amount with its currency, as the payment sheet shows it: "12.50 EUR" (amount); anyAmount for a code without one, whose payer types it in. amount is in the main unit with a dot, as PaymentContent.amount gives it.

Text(ScannerLocalizations.of(context)
    .amountOf(payment.amount, payment.currency))

Implementation

String amountOf(String? amount, String? currency) =>
    switch ((amount, currency)) {
      (null, _) => anyAmount,
      (final String amount, null) => amount,
      (final String amount, final String currency) => this.amount(
        amount,
        currency,
      ),
    };