NdefMessage class

An immutable NDEF message: an ordered list of records.

toBytes and fromBytes implement the NFC Forum wire format in Dart, so a message can be built or parsed without a tag in range. That matters in three places: host card emulation, where this side of the exchange has to produce the bytes itself; Android intents, which hand over already-serialized messages; and tests, which can then cover the codec without a device.

Constructors

NdefMessage(List<NdefRecord> records)
Constructs a message from records.
const
NdefMessage.fromBytes(Uint8List bytes)
Decodes a message from the NFC Forum wire format.
factory

Properties

byteLength int
The number of bytes this message occupies when stored on a tag.
no setter
hashCode int
The hash code for this object.
no setteroverride
records List<NdefRecord>
The records, in order.
final
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
toBytes() Uint8List
Encodes this message in the NFC Forum wire format.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override