MifareClassic class

NXP Mifare Classic. Android only -- iOS cannot talk to these tags at all, which is an Apple restriction rather than a gap in this package.

Properties

blockCount → int
How many 16-byte blocks the card holds in total.
final
hashCode → int
The hash code for this object.
no setterinherited
maxTransceiveLength → int
The value at discovery. Call getMaxTransceiveLength for the live one.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sectorCount → int
How many sectors the card holds. Sector sizes are not uniform -- see blockToSector.
final
size → int
The tag's total size in bytes.
final
timeout → Duration
The value at discovery. Call getTimeout for the live one.
final
type → MifareClassicType
Which Mifare Classic product this is.
final

Methods

authenticateSectorWithKeyA({required int sectorIndex, required Uint8List key}) → Future<bool>
Authenticates a sector with key A. Returns false when the key is wrong.
authenticateSectorWithKeyB({required int sectorIndex, required Uint8List key}) → Future<bool>
Authenticates a sector with key B. Returns false when the key is wrong.
blockToSector({required int blockIndex}) → Future<int>
The sector a block belongs to.
decrement({required int blockIndex, required int value}) → Future<void>
Subtracts from a value block, leaving the result in the internal transfer buffer.
getBlockCountInSector({required int sectorIndex}) → Future<int>
How many blocks a sector holds.
getMaxTransceiveLength() → Future<int>
The largest payload transceive accepts, in bytes.
inherited
getTimeout() → Future<Duration>
The current transceive timeout.
inherited
increment({required int blockIndex, required int value}) → Future<void>
Adds to a value block, leaving the result in the internal transfer buffer.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBlock({required int blockIndex}) → Future<Uint8List>
Reads one 16-byte block.
restore({required int blockIndex}) → Future<void>
Copies a value block into the internal transfer buffer.
sectorToBlock({required int sectorIndex}) → Future<int>
The first block of a sector.
setTimeout(Duration timeout) → Future<void>
Gives a slow tag more time before the exchange fails as lost.
inherited
toString() → String
A string representation of this object.
inherited
transceive(Uint8List data) → Future<Uint8List>
Sends a raw command to the tag and returns its answer.
inherited
transfer({required int blockIndex}) → Future<void>
Writes the internal transfer buffer to a value block.
writeBlock({required int blockIndex, required Uint8List data}) → Future<void>
Writes one 16-byte block.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

from(NfcTag tag) → MifareClassic?
Returns an instance for tag, or null when the tag is not a Mifare Classic.