Address.fromMap constructor

Address.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory Address.fromMap(Map<String, dynamic> map) {
  return Address(
    street: map['street'] ?? '',
    city: map['city'] ?? '',
    code: map['code'] ?? '',
    country: map['country'] != null
        ? Country.fromMap(map['country'])
        : Country.empty,
    latitude:
        map['latitude'] == null ? 0.0 : (map['latitude'] as num).toDouble(),
    longitude:
        map['longitude'] == null ? 0.0 : (map['longitude'] as num).toDouble(),
  );
}