FakeTech.ndefAndroid constructor
FakeTech.ndefAndroid({
- String type = 'org.nfcforum.ndef.type2',
- int maxSize = _ndefCapacity,
- bool isWritable = true,
- bool canMakeReadOnly = true,
- NdefMessage? cachedMessage,
android.nfc.tech.Ndef, which carries both Ndef and NdefAndroid.
cachedMessage is the way to hand a test a message without overriding a host API call:
it arrives as Ndef.from(tag)?.cachedMessage, the same snapshot a real discovery takes.
Implementation
factory FakeTech.ndefAndroid({
String type = 'org.nfcforum.ndef.type2',
int maxSize = _ndefCapacity,
bool isWritable = true,
bool canMakeReadOnly = true,
NdefMessage? cachedMessage,
}) => FakeTech._(
'Ndef',
(data) => data.ndefAndroid = NdefAndroidPigeon(
type: type,
maxSize: maxSize,
isWritable: isWritable,
canMakeReadOnly: canMakeReadOnly,
cachedMessage: cachedMessage == null ? null : ndefMessageToWire(cachedMessage),
),
);