Мое приложение больше не показывает плитки Google Maps, просто серый экран (с логотипом Google внизу). < /p>
У меня есть до сих пор: < /p>
Created a new Google Maps API key
Confirmed the app is using this new key
Ensured the key has no restrictions
Ensured the SDKs are enabled
Uninstalled/Reinstalled the app
Confirmed my billing it setup within Google correctly
< /code>
Я относительно уверен, что это не проблема с моим кодом, поскольку он влияет на несколько экранов, хотя это может быть проблемой совместимости. < /p>
Я использую: < /p>
Flutter 3.32.4;
xCode 16.3;
google_maps_flutter 2.12.3.
< /code>
Мое испытательное устройство - это физический телефон, работающий на iOS 18. Любой совет был бы с благодарностьюimport 'package:google_navigation_flutter/google_navigation_flutter.dart';
class NavigationScreen extends StatefulWidget {
final Map journey;
final List navigationSteps;
final List routePoints;
final Map startLocation;
const NavigationScreen({
super.key,
required this.journey,
required this.navigationSteps,
required this.routePoints,
required this.startLocation,
});
@override
State createState() => _NavigationScreenState();
}
class _NavigationScreenState extends State {
GoogleNavigationViewController? _controller;
bool _navigationSessionInitialized = false;
@override
void initState() {
super.initState();
_initializeNavigationSession();
}
Future _initializeNavigationSession() async {
if (!await GoogleMapsNavigator.areTermsAccepted()) {
await GoogleMapsNavigator.showTermsAndConditionsDialog(
'Navigation Terms',
'Please accept the terms to use navigation features.',
);
}
await GoogleMapsNavigator.initializeNavigationSession(
taskRemovedBehavior: TaskRemovedBehavior.continueService,
);
setState(() {
_navigationSessionInitialized = true;
});
}
void _onViewCreated(GoogleNavigationViewController controller) {
_controller = controller;
controller.setMyLocationEnabled(true);
}
@override
void dispose() {
if (_navigationSessionInitialized) {
GoogleMapsNavigator.cleanup();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.journey['title'] ?? 'Navigation'),
),
body: _navigationSessionInitialized
? GoogleMapsNavigationView(
onViewCreated: _onViewCreated,
)
: const Center(child: CircularProgressIndicator()),
);
}
}```
Подробнее здесь: https://stackoverflow.com/questions/796 ... rey-screen
Карты Google больше не показывают карты плитки, вместо этого серого экрана ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Карты Google больше не показывают карты плитки, вместо этого серого экрана
Anonymous » » в форуме IOS - 0 Ответы
- 3 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Imread оттенки серого отличается от imread + конвертировать в оттенки серого [дубликат]
Anonymous » » в форуме Python - 0 Ответы
- 23 Просмотры
-
Последнее сообщение Anonymous
-