toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
Map<String, dynamic> cardData = {};

  putIfValueNotNull("cvv", _cvv, cardData);
  putIfValueNotNull("expiryYear", _expiryYear, cardData);
  putIfValueNotNull("expiryMonth", _expiryMonth, cardData);
  putIfValueNotNull("number", _number, cardData);

  return cardData;
}