NdefRecord class
One immutable NDEF record.
Records read off a tag come back through NdefRecord.fromParts, which skips the creation-time validation: tags legitimately hold shapes the creation rules reject, and refusing to represent them would turn a readable tag into an exception. Records you build yourself go through the validating constructors.
For the well-known types there are typed views -- TextRecord, UriRecord, SmartPosterRecord, MimeRecord, ExternalRecord -- which both build and parse.
Constructors
- NdefRecord({required NdefTypeNameFormat typeNameFormat, required Uint8List type, required Uint8List identifier, required Uint8List payload})
-
Constructs a record, rejecting shapes the NDEF specification forbids.
factory
- NdefRecord.fromParts({required NdefTypeNameFormat typeNameFormat, required Uint8List type, required Uint8List identifier, required Uint8List payload})
-
Constructs a record from values that already exist on a tag or on the wire, without
the creation-time validation.
factory
Properties
- byteLength → int
-
The number of bytes this record occupies when stored on a tag.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- identifier → Uint8List
-
The record identifier. Usually empty.
final
- payload → Uint8List
-
The record content.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → Uint8List
-
The type, interpreted according to typeNameFormat.
final
- typeNameFormat → NdefTypeNameFormat
-
How the type field should be read.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- wellKnownTypeSmartPoster → Uint8List
-
The well-known type of a smart poster record.
final
- wellKnownTypeText → Uint8List
-
The well-known type of a text record.
final
- wellKnownTypeUri → Uint8List
-
The well-known type of a URI record.
final
Constants
-
uriPrefixList
→ const List<
String> - The NFC Forum URI prefixes, indexed by the first byte of a URI record's payload.