TextRecord class
A record holding UTF-8 or UTF-16 text, with the language it is written in.
final record = TextRecord.create('merhaba', languageCode: 'tr');
final parsed = TextRecord.from(record); // parsed.text == 'merhaba'
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isUtf16 → bool
-
Whether the payload was stored as UTF-16 rather than UTF-8.
final
- languageCode → String
-
The IANA language code the text is written in, such as
enortr.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
The decoded text.
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.
inherited
Static Methods
-
create(
String text, {String languageCode = 'en'}) → NdefRecord - Builds a well-known text record. Always encodes as UTF-8.
-
from(
NdefRecord record) → TextRecord? -
Reads
recordas a text record, or returns null when it is not one or is malformed.