formatAddress method
Implementation
String formatAddress({String delimiter = ', '}) {
var str = '';
if (address1 != null && address1!.isNotEmpty) {
str += address1! + delimiter;
}
if (address2 != null && address2!.isNotEmpty) {
str += address2! + delimiter;
}
if (city != null && city!.isNotEmpty) {
str += city! + delimiter;
}
if (state != null && state!.isNotEmpty) {
str += state! + delimiter;
}
if (postalCode != null && postalCode!.isNotEmpty) {
str += postalCode!;
}
return str.trim();
}