FlutterNfcKit class
Main class of NFC Kit
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
nfcAvailability
→ Future<
NFCAvailability> -
get the availablility of NFC reader on this device
no setter
-
tagStream
→ Stream<
NFCTag> -
Stream of NFC tag events. Each event is a NFCTag object.
no setter
Static Methods
-
authenticateSector<
T> (int index, {T? keyA, T? keyB}) → Future< bool> - Authenticate against a sector of MIFARE Classic tag (Android only).
-
finish(
{String? iosAlertMessage, String? iosErrorMessage, bool? closeWebUSB}) → Future< void> - Finish current session in polling mode.
-
iosRestartPolling(
) → Future< void> - Works only on iOS.
-
makeNdefReadOnly(
) → Future< void> - Make the NDEF tag readonly (i.e. lock the NDEF tag, Android & iOS only).
-
poll(
{Duration? timeout, bool androidPlatformSound = true, bool androidCheckNDEF = true, String iosAlertMessage = "Hold your iPhone near the card", String iosMultipleTagMessage = "More than one tags are detected, please leave only one tag and try again.", bool readIso14443A = true, bool readIso14443B = true, bool readIso18092 = false, bool readIso15693 = true, bool probeWebUSBMagic = false}) → Future< NFCTag> - Try to poll a NFC tag from reader.
-
readBlock(
int index, {Iso15693RequestFlags? iso15693Flags, bool iso15693ExtendedMode = false}) → Future< Uint8List> - Read one unit of data (specified below) from:
-
readNDEFRawRecords(
{bool? cached}) → Future< List< NDEFRawRecord> > - Read NDEF records (in raw data, Android & iOS only).
-
readNDEFRecords(
{bool? cached}) → Future< List< NDEFRecord> > - Read NDEF records (in decoded format, Android & iOS only).
-
readSector(
int index) → Future< Uint8List> - Read one sector from MIFARE Classic tag (Android Only)
-
setIosAlertMessage(
String message) → Future< void> -
iOS only, change currently displayed NFC reader session alert message with
message
. -
transceive<
T> (T capdu, {Duration? timeout}) → Future< T> -
Transceive data with the card / tag in the format of APDU (iso7816) or raw commands (other technologies).
The
capdu
can be either of type Uint8List or hex string. Return value will be in the same type ofcapdu
. -
writeBlock<
T> (int index, T data, {Iso15693RequestFlags? iso15693Flags, bool iso15693ExtendedMode = false}) → Future< void> - Write one unit of data (specified below) to:
-
writeNDEFRawRecords(
List< NDEFRawRecord> message) → Future<void> - Write NDEF records (in raw data, Android & iOS only).
-
writeNDEFRecords(
List< NDEFRecord> message) → Future<void> - Write NDEF records (in decoded format, Android & iOS only).
Constants
- POLL_TIMEOUT → const int
- Default timeout for poll (in milliseconds)
- TRANSCEIVE_TIMEOUT → const int
- Default timeout for transceive (in milliseconds)