HelloFro / yelp_fusion_client

A Dart Client to access the endpoints of Yelp Fusion API.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

fetchBusinessSearch() BusinessSearched dispalyPhone and reviewCount always null #13

Open HelloFro opened 1 year ago

HelloFro commented 1 year ago

simple fix:

factory BusinessSearched.fromMap(Map<String, dynamic>? map) {
    if (map == null) return BusinessSearched();

    return BusinessSearched(
      categories: Categories.fromList(map['categories']),
      coordinates: Coordinates.fromMap(map['coordinates']),
      displayPhone: map['displayPhone'], // needs to be 'display_phone'
      distance: map['distance'],
      id: map['id'],
      alias: map['alias'],
      imageUrl: map['image_url'],
      location: Location.fromMap(map['location']),
      name: map['name'],
      phone: map['phone'],
      price: map['price'],
      rating: map['rating'],
      reviewCount: map['reviewCount'], // needs to be 'review_count'
      url: map['url'],
      transactions: List<String>.from(map['transactions']),
    );
  }
HelloFro commented 1 year ago

fetchBusinessSearch() BusinessSearched dispalyPhone and reviewCount always null #13