NDEFRecord constructor

NDEFRecord({
  1. TypeNameFormat? tnf,
  2. Uint8List? type,
  3. Uint8List? id,
  4. Uint8List? payload,
})

Implementation

NDEFRecord(
    {TypeNameFormat? tnf, Uint8List? type, this.id, Uint8List? payload}) {
  flags = NDEFRecordFlags();
  if (tnf == null) {
    flags.TNF = TypeNameFormat.values.indexOf(this.tnf);
  } else {
    if (this.tnf != TypeNameFormat.empty) {
      throw ArgumentError("TNF has not been set in subclass of Record");
    }
    this.tnf = tnf;
  }
  this.type = type;
  // some subclasses' setters require payload != null
  if (payload != null) {
    this.payload = payload;
  }
}