places_service
0.1.5, released a year ago by filledstacks.com
Dart service for Google Places API auto-complete, details, and nearby searches
$ flutter pub add places_serviceWhat it does
Provides methods to fetch place auto-complete suggestions, detailed place info, and nearby places using the Google Places API. It manages session tokens and handles errors via a custom exception.
AI-written summary of version 0.1.5, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need place suggestions while typing an address
- You need detailed place data after selecting a suggestion
- You want to show nearby places based on current location
Skip it when
- You only need basic map display without place queries
- You prefer a fully featured map widget library instead of a service
Strengths
- Simple API, no code generation required
- Handles session tokens automatically
- Supports Android, iOS, web, windows, macos
Weaknesses
- Relies on external Google API key and billing
- No built-in caching or offline support
- Limited to Places API features only
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 5
Add dependency, call initialize(apiKey: 'YOUR_KEY') before use. Ensure location permissions for nearby places.
final service = PlacesService();
service.initialize(apiKey: 'YOUR_KEY');
final suggestions = await service.getAutoComplete('new york');
final details = await service.getPlaceDetails(suggestions.first.placeId);Alternatives
Packages that do the same job and could replace places_service.
- nominatim_flutter
Flutter plugin for Nominatim reverse geocoding, place searches, lookups and caching.
55Compare - flutter_google_maps_webservices
Google maps web services for Flutter (Geocoding, Places, Directions, Distance Matrix, etc.)
50Compare - flutter_geofire
Flutter plugin for realtime location queries using GeoFire and Firebase.
48Compare - geoclue
Dart client for the GeoClue D-Bus geolocation service on Linux.
50Compare
Works with
Packages commonly used together with places_service: ones it builds on, ones built on it, and its own family.
- uuidplaces_service depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- json_annotationplaces_service depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- freezed_annotationplaces_service depends on itAnnotations for the freezed code-generator.
- geolocatorplaces_service depends on itCross-platform plugin to access device GPS, location updates, and coordinate calculations.
- google_maps_apisplaces_service depends on itDart client library for Google Maps Web Services APIs.