toCardOptionScreen method

Future<void> toCardOptionScreen(
  1. RouteSettings settings,
  2. BuildContext context,
  3. Locale locale,
  4. OnPayCallback onPay,
  5. EventCallback? log,
)

Navigates to the manual card entry screen.

This method presents a screen where users can manually enter their card information, including card number, expiry date, and CVV.

Parameters:

  • settings - Route settings containing payment arguments
  • context - The current build context for navigation
  • locale - Locale setting for internationalization
  • onPay - Callback function executed when payment is completed
  • log - Optional callback for logging events and analytics

Payment Arguments

Extracts the following information from route settings:

  • Currency and currency ID
  • Terminal and merchant IDs
  • Payment amount
  • Transaction identifier

Example

await AmwalSdkNavigator.instance.toCardOptionScreen(
  settings,
  context,
  const Locale('en'),
  (result) =&gt; print('Manual card payment completed: $result'),
  (event, params) =&gt; logEvent(event, params),
);

Navigates to the manual card entry screen.

Implementation

Future<void> toCardOptionScreen(
  RouteSettings settings,
  BuildContext context,
  Locale locale,
  OnPayCallback onPay,
  EventCallback? log,
) async {
  final arguments = settings.arguments as PaymentArguments;
  await Navigator.of(context).push(
    MaterialPageRoute(
      builder: (_) => SaleByCardManualScreen(
        onPay: onPay,
        locale: locale,
        currency: arguments.currencyData!.name,
        currencyId: arguments.currencyData!.idN,
        terminalId: arguments.terminalId,
        amount: arguments.amount,
        merchantId: arguments.merchantId,
        transactionId: arguments.transactionId,
        log: log,
      ),
      settings: settings,
    ),
  );
}