toMap method

Map<String, String>? toMap()

Implementation

Map<String, String>? toMap() {
  if (this == null) return null;
  final address = this!;
  final map = {
    _klabel: address.label,
    _kstreet: address.street,
    _kcity: address.city,
    _kpostcode: address.postcode,
    _kregion: address.region,
    _kcountry: address.country
  }.valuesNotNull();

  /// There will always be a type field, so make sure there's at least one more
  return map.length <= 1 ? null : map;
}