Open Panimaster opened 2 months ago
In general no field should ever be assumed to be present in a JSON response. To keep required fields non-nullable, while reporting a better error message in these cases, an informative exception should be thrown:
placeId: json['place_id'] as String? ?? throw 'JSON is missing the "place_id" field',
We get the following error using the getDetailsByPlaceId method:
⛔ type 'Null' is not a subtype of type 'String' in type cast<…>
Looking into the issue we found out that the issue is that PlaceDetailsFromJson requires placeID to be part of the response JSON which is unfortunately not present: