toJson method Null safety

Map toJson()

Implementation

Map toJson(){
  Map result = {};

  if (aTQA != null) result.addAll({"aTQA": aTQA});
  if (bitRateR != null) result.addAll({"bitRateR": bitRateR});
  if (bitRateS != null) result.addAll({"bitRateS": bitRateS});
  if (chipTypeA != null) result.addAll({"chipTypeA": chipTypeA});
  if (mifareMemory != null) result.addAll({"mifareMemory": mifareMemory});
  if (rfidType != null) result.addAll({"rfidType": rfidType});
  if (sAK != null) result.addAll({"sAK": sAK});
  if (support4 != null) result.addAll({"support4": support4});
  if (supportMifare != null) result.addAll({"supportMifare": supportMifare});
  if (aTQB != null) result.addAll({"aTQB": aTQB});
  if (aTR != null) result.addAll({"aTR": aTR});
  if (baudrate1 != null) result.addAll({"baudrate1": baudrate1});
  if (baudrate2 != null) result.addAll({"baudrate2": baudrate2});
  if (uID != null) result.addAll({"uID": uID});

  return result;
}