PlaceDetail class
Data model representing detailed information about a place from Google Places API.
Contains comprehensive place data including address, business hours, photos, reviews, ratings, and more. This model is typically fetched using a place_id obtained from the autocomplete API.
Example usage:
final detailResponse = await apiClient.getPlaceDetails(placeId: 'ChIJ...');
final placeDetail = PlaceDetail.fromJson(detailResponse.data);
print('Name: ${placeDetail.result?.name}');
print('Address: ${placeDetail.result?.formattedAddress}');
print('Rating: ${placeDetail.result?.rating}');
print('Phone: ${placeDetail.result?.formattedPhoneNumber}');
See also:
- Result for the detailed place information
- Geometry for location coordinates
- OpeningHours for business hours
- Review for user reviews
Constructors
- PlaceDetail({List? htmlAttributions, Result? result})
- Creates a PlaceDetail instance.
-
PlaceDetail.fromJson(Map<
String, dynamic> json) -
Creates a PlaceDetail from Google Places API JSON response.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- htmlAttributions ↔ List?
-
HTML attributions required when displaying place data
getter/setter pair
- result ↔ Result?
-
Detailed information about the place
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited