feat: Implement platform-specific Google Maps API key handling and update app version.
Some checks failed
Deploy to Play Store / build_and_deploy (push) Has been cancelled
Some checks failed
Deploy to Play Store / build_and_deploy (push) Has been cancelled
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
@@ -13,7 +14,19 @@ class ActivityPlacesService {
|
||||
ActivityPlacesService._internal();
|
||||
|
||||
final ErrorService _errorService = ErrorService();
|
||||
static final String _apiKey = dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
|
||||
static String get _apiKey {
|
||||
if (Platform.isAndroid) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_ANDROID'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
} else if (Platform.isIOS) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_IOS'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
}
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
}
|
||||
|
||||
/// Recherche des activités près d'une destination
|
||||
Future<List<Activity>> searchActivities({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
@@ -5,7 +6,19 @@ import 'package:firebase_storage/firebase_storage.dart';
|
||||
import 'package:travel_mate/services/error_service.dart';
|
||||
|
||||
class PlaceImageService {
|
||||
static final String _apiKey = dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
static String get _apiKey {
|
||||
if (Platform.isAndroid) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_ANDROID'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
} else if (Platform.isIOS) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_IOS'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
}
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
}
|
||||
|
||||
final FirebaseStorage _storage = FirebaseStorage.instance;
|
||||
final ErrorService _errorService = ErrorService();
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
@@ -13,7 +14,18 @@ class TripGeocodingService {
|
||||
TripGeocodingService._internal();
|
||||
|
||||
final ErrorService _errorService = ErrorService();
|
||||
static final String _apiKey = dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
static String get _apiKey {
|
||||
if (Platform.isAndroid) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_ANDROID'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
} else if (Platform.isIOS) {
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY_IOS'] ??
|
||||
dotenv.env['GOOGLE_MAPS_API_KEY'] ??
|
||||
'';
|
||||
}
|
||||
return dotenv.env['GOOGLE_MAPS_API_KEY'] ?? '';
|
||||
}
|
||||
|
||||
/// Géocode la destination d'un voyage et retourne un Trip mis à jour
|
||||
Future<Trip> geocodeTrip(Trip trip) async {
|
||||
|
||||
Reference in New Issue
Block a user