toCardContactLessOptionScreen method

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

Navigates to the contactless card payment screen.

This method presents a screen for contactless card payments using NFC technology or other contactless payment methods.

Parameters:

  • settings - Route settings containing payment arguments
  • context - The current build context for navigation
  • locale - Locale setting for internationalization
  • onPay - Optional callback function for payment completion

Contactless Features

The contactless screen supports:

  • NFC card reading
  • Contactless payment processing
  • Real-time payment status updates
  • Secure payment authentication

Example

await AmwalSdkNavigator.instance.toCardContactLessOptionScreen(
  settings,
  context,
  const Locale('en'),
  (result) =&gt; print('Contactless payment completed: $result'),
);

Navigates to the contactless card payment screen.

Implementation

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