SmartPosterRecord class
A NDEF Smart Poster record containing rich metadata about a URI.
Smart Posters can contain title, URI, action, icon, size, and type records to provide a complete description of a resource.
- Inheritance
-
- Object
- NDEFRecord
- WellKnownRecord
- SmartPosterRecord
Constructors
-
SmartPosterRecord({dynamic title, dynamic uri, Action? action, Map<
String, Uint8List> ? icon, int? size, String? typeInfo}) - Constructs a SmartPosterRecord with optional metadata fields.
-
SmartPosterRecord.fromList({List<
TextRecord> ? titleRecords, List<UriRecord> ? uriRecords, List<ActionRecord> ? actionRecords, List<MimeRecord> ? iconRecords, List<SizeRecord> ? sizeRecords, List<TypeRecord> ? typeRecords}) - Constructs a SmartPosterRecord from lists of constituent records.
Properties
- action ↔ Action?
-
Gets the first action if it exists.
getter/setter pair
-
actionRecords
→ List<
NDEFRecord> -
Gets a copy of the action records list.
no setter
-
allRecords
→ List<
NDEFRecord> -
Gets all constituent records as a single list.
no setter
- basicInfoString → String
-
Gets a basic information string containing ID, TNF, and type.
no setterinherited
- decodedType ↔ String
-
Gets the type as a decoded UTF-8 string.
getter/setter pairinherited-setteroverride-getter
- encodedType ↔ Uint8List?
-
The raw encoded type bytes.
getter/setter pairinherited
- flags ↔ NDEFRecordFlags
-
The flags header of the record.
getter/setter pairinherited
- fullType → String?
-
Gets the full qualified type including TNF prefix.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
icon
↔ Map<
String?, Uint8List?> ? -
Gets the first icon as a map of MIME type to payload.
getter/setter pair
- iconRecord ↔ MimeRecord?
-
Gets the first icon record if it exists.
getter/setter pair
-
iconRecords
→ List<
NDEFRecord> -
Gets a copy of the icon records list.
no setter
- id ↔ Uint8List?
-
The ID of the record (optional).
getter/setter pairinherited
- idString ↔ String
-
Hex String of id, return "(empty)" when the id bytes is null
getter/setter pairinherited
- maxPayloadLength → int?
-
Gets the maximum payload length for this record instance.
no setterinherited
- minPayloadLength → int
-
Gets the minimum payload length for this record instance.
no setterinherited
- payload ↔ Uint8List
-
The payload data of the record.
getter/setter pairoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size ↔ int?
-
Gets the first size if it exists.
getter/setter pair
-
sizeRecords
→ List<
NDEFRecord> -
Gets a copy of the size records list.
no setter
- title ↔ String?
-
Gets the English title; if not existing, gets the first title.
getter/setter pair
-
titleRecords
→ List<
NDEFRecord> -
Gets a copy of the title records list.
no setter
-
titles
→ Map<
String?, String?> -
Gets all titles as a map of language code to text.
no setter
- tnf ↔ TypeNameFormat
-
Gets the Type Name Format of this record.
getter/setter pairinherited
- type ↔ Uint8List?
-
Gets the type as raw bytes.
getter/setter pairinherited
- typeInfo ↔ String?
-
Gets the first type info if it exists.
getter/setter pair
-
typeRecords
→ List<
NDEFRecord> -
Gets a copy of the type records list.
no setter
- uri ↔ Uri?
-
Gets the URI if exactly one URI record exists.
getter/setter pair
- uriRecord → UriRecord?
-
Gets the single URI record if exactly one exists.
no setter
-
uriRecords
→ List<
NDEFRecord> -
Gets a copy of the URI records list.
no setter
Methods
-
addActionRecord(
ActionRecord record) → void - Adds an action record.
-
addIcon(
Map< String, Uint8List> icon) → void - Adds an icon with the specified MIME type and data.
-
addIconRecord(
MimeRecord record) → void - Adds an icon record.
-
addSizeRecord(
SizeRecord record) → void - Adds a size record.
-
addTitle(
String text, {String language = 'en', TextEncoding encoding = TextEncoding.UTF8}) → void -
Adds a title with the specified
text,language, andencoding. -
addTitleRecord(
TextRecord record) → void - Adds a title record (language must be unique).
-
addTypeRecord(
TypeRecord record) → void - Adds a type record.
-
addUriRecord(
UriRecord record) → void - Adds a URI record (Smart Poster must have exactly one).
-
encode(
) → Uint8List -
Encode this NDEFRecord to raw byte data.
inherited
-
isEqual(
NDEFRecord other) → bool -
Checks if this record is equal to
otherby comparing TNF, type, ID, and payload.override -
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.
inherited
Static Methods
-
typeFactory(
TypeNameFormat tnf, String classType) → NDEFRecord - Type factory for Smart Poster constituent records.