read static method
Implementation
static Future<ChipRead> read(ChipAccess access) async {
try {
final raw = await _channel.invokeMapMethod<Object?, Object?>('readBac', {
'documentNumber': access.documentNumber,
'documentNumberCheck': access.documentNumberCheck,
'birth': access.birth,
'birthCheck': access.birthCheck,
'expiry': access.expiry,
'expiryCheck': access.expiryCheck,
});
if (raw == null) return const ChipRead(status: 'error');
return ChipRead(
status: raw['status'] as String? ?? 'error',
dg1: raw['dg1'] as String?,
sw: raw['sw'] as String?,
);
} on MissingPluginException {
// No NFC channel on this platform, including every iOS build.
return const ChipRead(status: 'no-nfc');
} on PlatformException catch (error) {
return ChipRead(status: 'error', sw: error.code);
}
}