google_places_kit 0.1.0
google_places_kit: ^0.1.0 copied to clipboard
Google Places API (New) and Geocoding for Flutter: autocomplete, place details, nearby and text search, photos, address to lat/lng and back.
0.1.0 #
GooglePlacesclient for Places API (New) and the Geocoding API, in pure Dart: works on Android, iOS, web and desktop.autocompletewith session tokens, location bias or restriction, place types, countries and distance from an origin.detailswith field masks (PlaceField, withbasic,address,detailsandallpresets), so requests ask only for what they show.searchText(with paging throughnextPageToken) andsearchNearby, with type, rating and open-now filters and ranking by distance.photoUrlreturns a key-free image URL; photo and review author attributions are included.- Typed models for every response:
Placewith opening hours and periods, photos, reviews, AI summaries, amenities, accessibility, parking, payment, fuel prices, EV chargers, landmarks, postal address, Google Maps links and more;PlaceSuggestionwith match offsets;GeocodingResultwith location type, viewport and plus code. reverseGeocode(coordinates to address) andgeocode(address to coordinates).AddressPartsgetters on address components:street,area,city,district,state,postalCode,country,countryCodeand more.PlacesExceptionwith aPlacesErrorCodefor a wrong key, a disabled API, missing billing, key restrictions, quotas, bad requests, network and server errors, plus Google's own message.GooglePlaces.initialize()once inmain(), thenGooglePlaces.instanceanywhere; the widgets and controller use it when no client is passed.- Modern widgets:
PlaceAutocompleteField(rounded field, floating panel with place-type icons, highlighted matches, loading skeleton, no-results and error states, animations, arrow keys and Enter),showPlaceSearch/PlaceSearchPage,PlaceSuggestionsPanel,PlaceSuggestionTile,PlaceSuggestionSkeleton,PlaceTypeIconandGoogleMapsAttribution, with builders for the field, each suggestion and the whole panel. PlacesKitThemeto restyle every widget fromThemeData; defaults follow the app's color scheme in light and dark mode.showAttributionon each widget and inPlacesKitTheme, for apps that show results on a Google map or credit Google elsewhere. On by default.PlaceAutocompleteController: the widgets' search logic (debouncing, sessions, loading and error state) without UI, for your own design.- Headers for keys restricted to an Android app (package name and SHA-1) or an iOS app (bundle ID).