FakeTech.mifareClassic constructor

FakeTech.mifareClassic({
  1. MifareClassicType type = MifareClassicType.classic,
  2. int blockCount = 64,
  3. int sectorCount = 16,
  4. int size = MifareClassic.size1K,
  5. int maxTransceiveLength = _maxTransceiveLength,
  6. Duration timeout = _timeout,
})

android.nfc.tech.MifareClassic.

The geometry defaults to a 1K card -- 64 blocks in 16 sectors of four -- and so does FakeNfcAndroidHostApi's answer to blockToSector and its neighbours, so the static description and the calls that read it agree unless a test changes one of them.

Implementation

factory FakeTech.mifareClassic({
  MifareClassicType type = MifareClassicType.classic,
  int blockCount = 64,
  int sectorCount = 16,
  int size = MifareClassic.size1K,
  int maxTransceiveLength = _maxTransceiveLength,
  Duration timeout = _timeout,
}) => FakeTech._(
  'MifareClassic',
  (data) => data.mifareClassic = MifareClassicPigeon(
    type: _mifareClassicTypeToWire(type),
    blockCount: blockCount,
    sectorCount: sectorCount,
    size: size,
    maxTransceiveLength: maxTransceiveLength,
    timeout: timeout.inMilliseconds,
  ),
);