NDEFRecord constructor

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

Implementation

NDEFRecord(
    {TypeNameFormat? tnf,
    Uint8List? type,
    Uint8List? id,
    Uint8List? payload}) {
  flags = new 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;
  this.id = id;
  // some subclasses' setters require payload != null
  if (payload != null) {
    this.payload = payload;
  }
}