payload property

  1. @override
Uint8List get payload
override

Implementation

@override
Uint8List get payload {
  if (_uriRecords.length != 1) {
    throw ArgumentError.value(_uriRecords.length,
        "Number of URI Record in Smart Poster Record must be 1");
  }
  return encodeNdefMessage(allRecords);
}
  1. @override
set payload (Uint8List? payload)
override

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");
  }
}