Update map autocompletion
All checks were successful
Deploy TravelMate (Full Mobile) / deploy-android (push) Successful in 2m5s
Deploy TravelMate (Full Mobile) / deploy-ios (push) Successful in 3m53s

This commit is contained in:
Van Leemput Dayron
2026-01-13 17:15:22 +01:00
parent c0e53cd3f6
commit b511ec5df0
3 changed files with 4 additions and 43 deletions

View File

@@ -24,6 +24,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../../services/place_image_service.dart'; import '../../services/place_image_service.dart';
import '../../services/trip_geocoding_service.dart'; import '../../services/trip_geocoding_service.dart';
import '../../services/logger_service.dart'; import '../../services/logger_service.dart';
import '../../firebase_options.dart';
/// Create trip content widget for trip creation and editing functionality. /// Create trip content widget for trip creation and editing functionality.
/// ///
@@ -86,16 +87,7 @@ class _CreateTripContentState extends State<CreateTripContent> {
/// Google Maps API key for location services /// Google Maps API key for location services
static String get _apiKey { static String get _apiKey {
if (Platform.isAndroid) { return DefaultFirebaseOptions.currentPlatform.apiKey;
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'] ?? '';
} }
/// Participant management /// Participant management

View File

@@ -6,6 +6,7 @@ import 'dart:convert';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'dart:ui' as ui; import 'dart:ui' as ui;
import 'package:flutter_dotenv/flutter_dotenv.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart';
import '../../firebase_options.dart';
import '../../services/error_service.dart'; import '../../services/error_service.dart';
import '../../services/map_navigation_service.dart'; import '../../services/map_navigation_service.dart';
import '../../services/logger_service.dart'; import '../../services/logger_service.dart';
@@ -34,16 +35,7 @@ class _MapContentState extends State<MapContent> {
List<PlaceSuggestion> _suggestions = []; List<PlaceSuggestion> _suggestions = [];
static String get _apiKey { static String get _apiKey {
if (Platform.isAndroid) { return DefaultFirebaseOptions.currentPlatform.apiKey;
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'] ?? '';
} }
@override @override

View File

@@ -27,18 +27,6 @@ class DefaultFirebaseOptions {
return android; return android;
case TargetPlatform.iOS: case TargetPlatform.iOS:
return ios; return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
return windows;
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default: default:
throw UnsupportedError( throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.', 'DefaultFirebaseOptions are not supported for this platform.',
@@ -63,15 +51,4 @@ class DefaultFirebaseOptions {
iosClientId: '521527250907-3i1qe2656eojs8k9hjdi573j09i9p41m.apps.googleusercontent.com', iosClientId: '521527250907-3i1qe2656eojs8k9hjdi573j09i9p41m.apps.googleusercontent.com',
iosBundleId: 'com.example.travelMate', iosBundleId: 'com.example.travelMate',
); );
static const FirebaseOptions windows = FirebaseOptions(
apiKey: 'AIzaSyC4t-WOvp22zns9b9t58urznsNAhSHRAag',
appId: '1:521527250907:web:53ff98bcdb8c218f7da1fe',
messagingSenderId: '521527250907',
projectId: 'travelmate-a47f5',
authDomain: 'travelmate-a47f5.firebaseapp.com',
storageBucket: 'travelmate-a47f5.firebasestorage.app',
measurementId: 'G-J246Y7J61M',
);
} }