addressToString function

Iterable<String>? addressToString(
  1. SunnyPlace? address
)

Implementation

Iterable<String>? addressToString(SunnyPlace? address) {
  if (address == null) {
    return null;
  }

  final statePostal =
      Lists.compactEmpty([address.region, address.postalCode]).join(", ");
  final regionLine =
      Lists.compactEmpty([address.locality, statePostal]).join(" ");
  return Lists.compactEmpty([
    address.description,
    address.streetLineOne,
    address.streetLineTwo,
    address.streetLineThree,
    regionLine,
  ]);
}