https://github.com/nikhilmufc7/Flutter_GreatPlaces
A favorite place bookmarker app using Flutter, Google Maps and Native device features
https://github.com/nikhilmufc7/Flutter_GreatPlaces
Last synced: 6 months ago
JSON representation
A favorite place bookmarker app using Flutter, Google Maps and Native device features
- Host: GitHub
- URL: https://github.com/nikhilmufc7/Flutter_GreatPlaces
- Owner: nikhilmufc7
- Created: 2019-09-28T18:20:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-04T17:48:46.000Z (about 6 years ago)
- Last Synced: 2024-11-18T06:47:09.585Z (11 months ago)
- Language: Dart
- Homepage:
- Size: 88.9 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- flutter-guide - Flutter Implementation of Google Maps API
README
# Flutter Great Place
- Uses Flutter
- Google Maps
- Native Device features
## How to run locally
```
git clone
```
```
create a location_helper.dart file in helpers folder
```
```
Get your Google Cloud API Key
```
```
Add this to the location_helper.dart file
Add your api key to the variable
import 'package:http/http.dart' as http;
import 'dart:convert';
const GOOGLE_API_KEY = 'YOUR API KEY';
class LocationHelper {
static String generateLocationPreviewImage({
double latitude, double longitude,}) {
return 'https://maps.googleapis.com/maps/api/staticmap?center=$latitude,$longitude&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C$latitude,$longitude&key=$GOOGLE_API_KEY';
}
static Future getPlaceAddress( double lat, double lng) async{
final url = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=$lat,$lng&key=$GOOGLE_API_KEY';
final response = await http.get(url);
return json.decode(response.body)['results'][0]['formatted_address'];
}
}
```