toJson method
Serializes this instance to a JSON-compatible map.
Used internally, not intended for direct use by consumers. The map structure may change without notice.
Implementation
Map<String, String> toJson() {
final Map<String, String> json = <String, String>{};
for (final AddressField field in AddressField.values) {
final String? value = getField(field);
if (value != null && value.isNotEmpty) {
json[AddressFieldExtension.toActualString(field)] = value;
}
}
return json;
}