Implementation
@override
set payload(Uint8List? payload) {
decodeRawNdefMessage(payload!, typeFactory: SmartPosterRecord.typeFactory)
.forEach((e) {
if (e is TextRecord) {
addTitleRecord(e);
} else if (e is UriRecord) {
addUriRecord(e);
} else if (e is MimeRecord) {
addIconRecord(e);
} else if (e is ActionRecord) {
addActionRecord(e);
} else if (e is SizeRecord) {
addSizeRecord(e);
} else if (e is TypeRecord) {
addTypeRecord(e);
}
});
if (uriRecords.length != 1) {
throw ArgumentError.value(uriRecords.length,
"Number of URI Record in Smart Poster Record must be 1");
}
}