startCardScan method

  1. @override
Future<CardScanResult> startCardScan({
  1. DyScanUiSettings? uiSettings,
})
override

Implementation

@override
Future<CardScanResult> startCardScan({DyScanUiSettings? uiSettings}) async {
  try {
    uiSettings = uiSettings ?? DyScanUiSettings.defaultUiSettings;

    Map<String, dynamic> arguments = uiSettings.asMap();

    return await _methodChannel
        .invokeMethod('startCardScan', arguments)
        .then((result) {
      return CardScanResult.fromMap(Map<String, dynamic>.from(result));
    });
  } on PlatformException catch (e) {
    throw DyScanException.fromPlatformException(e);
  }
}