Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google maps not showing always in Safari browser #116969

Open
raman-kumar-ha opened this issue Dec 13, 2022 · 19 comments
Open

Google maps not showing always in Safari browser #116969

raman-kumar-ha opened this issue Dec 13, 2022 · 19 comments
Labels
browser: safari-macos only manifests in Safari on macOS found in release: 3.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@raman-kumar-ha
Copy link

Screen.Recording.2022-12-13.at.4.mp4

google_maps_flutter: ^2.1.12

[✓] Flutter (Channel stable, 3.3.4, on macOS 12.5 21G72 darwin-arm, locale en-IN)
• Flutter version 3.3.4 on channel stable at /Users/admin/Documents/flutter_sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86e (10 weeks ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/admin/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5 21G72 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.98

[✓] HTTP Host Availability
• All required HTTP hosts are available

@huycozy huycozy added the in triage Presently being triaged by the triage team label Dec 14, 2022
@huycozy
Copy link
Member

huycozy commented Dec 14, 2022

Hi @raman-kumar-ha
Please retry on the latest google_maps_flutter: ^2.2.2 plugin and the latest Flutter versions (stable and master) to see if the issue still persists or not.

In case the issue still persists, please provide a completed and minimal reproducible code sample so that we may verify this. Thanks!

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 14, 2022
@raman-kumar-ha
Copy link
Author

@huycozy Hi, Yes i already updated to latest version but still the issue is there

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 19, 2022
@huycozy
Copy link
Member

huycozy commented Dec 19, 2022

@raman-kumar-ha Thanks for trying the latest version. Please also provide a completed and minimal reproducible code sample so that we may verify this.

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 19, 2022
@raman-kumar-ha
Copy link
Author

raman-kumar-ha commented Dec 22, 2022

Hi @huycozy
Code below used in our project:

BaseLocation.dart build method

Scaffold(
      backgroundColor: ColorResources.haCardBgColor,
      body: SingleChildScrollView(
        child: Container(
          height: MediaQuery
              .of(context)
              .size
              .height,
          width: MediaQuery
              .of(context)
              .size
              .width,
          child: StreamBuilder(
              stream: usercontroller.myProfileBroadcastStream,
              builder: (context, snapshot) {
                return InkWell(
                  onTap: () {
                    setState(() {
                      searchPlacesController.searchPlacesResults.clear();
                    });
                  },
                  child: Stack(
                    children: [
                      ResponsiveWidget.isLargeScreen(context)
                          ? Padding(
                        padding:
                        const EdgeInsets.fromLTRB(40, 10, 40, 10),
                        child: ClipRRect(
                          borderRadius: BorderRadius.circular(
                              Dimensions.Radius_SIZE_EXTRA_LARGE),
                          child: Card(
                            child: LocationMap(
                              isLocationFromGooglePlaces:
                              isLocationFromGooglePlaces,
                              latitude: latitude,
                              longitude: longitude,
                              onLocationUpdate: onLocationUpdate,
                              onAddressSelected: onAddressSelected,
                              currentAddress: currentAddress,
                            ),
                          ),
                        ),
                      )
                          : LocationMap(
                        isLocationFromGooglePlaces:
                        isLocationFromGooglePlaces,
                        latitude: latitude,
                        longitude: longitude,
                        onLocationUpdate: onLocationUpdate,
                        onAddressSelected: onAddressSelected,
                        currentAddress: currentAddress,
                      ),
                      ResponsiveWidget.isLargeScreen(context)
                          ? BaseLocationLargeScreenLayout(
                          baselocationKey: baselocationKey,
                          searchPlaces: SearchPlacesComponent(
                            searchFieldText: searchFieldText,
                            searchFieldCall: searchField,
                            isGoogleMapRequired: true,
                            isLocationFromGooglePlaces:
                            isLocationFromGooglePlaces,
                            latitude: latitude,
                            longitude: longitude,
                            onLocationUpdate: onLocationUpdate,
                            onAddressSelected: onAddressSelected,
                            onLocationSelected: onLocationSelected,
                          ),
                          units: selectUnits(context),
                          title: title(context),
                          radius: selectRadius(context),
                          skipButton: previousButton(context),
                          continueButton: continueButton(context))
                          : BaseLocationSmallScreenLayout(
                          baselocationKey: baselocationKey,
                          searchPlaces: SearchPlacesComponent(
                            searchFieldText: searchFieldText,
                            searchFieldCall: searchField,
                            isGoogleMapRequired: true,
                            isLocationFromGooglePlaces:
                            isLocationFromGooglePlaces,
                            latitude: latitude,
                            longitude: longitude,
                            onLocationUpdate: onLocationUpdate,
                            onAddressSelected: onAddressSelected,
                            onLocationSelected: onLocationSelected,
                          ),
                          units: selectUnits(context),
                          title: title(context),
                          radius: selectRadius(context),
                          previousButton: previousButton(context),
                          continueButton: continueButton(context)),
                    ],
                  ),
                );
              }),
        ),
      ),
    )
Where build method of **BaseLocationMap** widget is 


```

Scaffold(
backgroundColor: ColorResources.haCardBgColor,
body: SingleChildScrollView(
child: Container(
height: MediaQuery
.of(context)
.size
.height,
width: MediaQuery
.of(context)
.size
.width,
child: StreamBuilder(
stream: usercontroller.myProfileBroadcastStream,
builder: (context, snapshot) {
return InkWell(
onTap: () {
setState(() {
searchPlacesController.searchPlacesResults.clear();
});
},
child: Stack(
children: [
ResponsiveWidget.isLargeScreen(context)
? Padding(
padding:
const EdgeInsets.fromLTRB(40, 10, 40, 10),
child: ClipRRect(
borderRadius: BorderRadius.circular(
Dimensions.Radius_SIZE_EXTRA_LARGE),
child: Card(
child: LocationMap(
isLocationFromGooglePlaces:
isLocationFromGooglePlaces,
latitude: latitude,
longitude: longitude,
onLocationUpdate: onLocationUpdate,
onAddressSelected: onAddressSelected,
currentAddress: currentAddress,
),
),
),
)
: LocationMap(
isLocationFromGooglePlaces:
isLocationFromGooglePlaces,
latitude: latitude,
longitude: longitude,
onLocationUpdate: onLocationUpdate,
onAddressSelected: onAddressSelected,
currentAddress: currentAddress,
),
ResponsiveWidget.isLargeScreen(context)
? BaseLocationLargeScreenLayout(
baselocationKey: baselocationKey,
searchPlaces: SearchPlacesComponent(
searchFieldText: searchFieldText,
searchFieldCall: searchField,
isGoogleMapRequired: true,
isLocationFromGooglePlaces:
isLocationFromGooglePlaces,
latitude: latitude,
longitude: longitude,
onLocationUpdate: onLocationUpdate,
onAddressSelected: onAddressSelected,
onLocationSelected: onLocationSelected,
),
units: selectUnits(context),
title: title(context),
radius: selectRadius(context),
skipButton: previousButton(context),
continueButton: continueButton(context))
: BaseLocationSmallScreenLayout(
baselocationKey: baselocationKey,
searchPlaces: SearchPlacesComponent(
searchFieldText: searchFieldText,
searchFieldCall: searchField,
isGoogleMapRequired: true,
isLocationFromGooglePlaces:
isLocationFromGooglePlaces,
latitude: latitude,
longitude: longitude,
onLocationUpdate: onLocationUpdate,
onAddressSelected: onAddressSelected,
onLocationSelected: onLocationSelected,
),
units: selectUnits(context),
title: title(context),
radius: selectRadius(context),
previousButton: previousButton(context),
continueButton: continueButton(context)),
],
),
);
}),
),
),
)

    

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 22, 2022
@huycozy
Copy link
Member

huycozy commented Dec 22, 2022

@raman-kumar-ha
For the issue to be workable, it needs to be reproducible with a completed and minimal reproducible code sample that doesn’t include 3rd party plugins or complex production code. Please provide such a sample.

Also, you may try running google_maps_flutter/example on your Safari to check if the issue still persists or not.

Thank you!

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 22, 2022
@raman-kumar-ha
Copy link
Author

@huycozy Hi , did you try my code?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 28, 2022
@huycozy
Copy link
Member

huycozy commented Dec 28, 2022

@raman-kumar-ha Your sample code is containing dependencies and is not complete/minimal to reproduce the issue. Please double-check my previous comment where you can find the plugin example that you can try with it.

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 28, 2022
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

@raman-kumar-ha
Copy link
Author

Okay i am going to post the relavent code

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 18, 2023
@github-actions github-actions bot reopened this Jan 18, 2023
@huycozy
Copy link
Member

huycozy commented Jan 19, 2023

@raman-kumar-ha As I suggested above, you may try running google_maps_flutter/example on your Safari to check if the issue still persists or not.

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 19, 2023
@raman-kumar-ha
Copy link
Author

@huycozy Yes i am gonna try it and will update here.
Thanks for the follow up

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 19, 2023
@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 20, 2023
@raman-kumar-ha
Copy link
Author

@huycozy Hi,
I have created a simple screen with the sample code on https://pub.dev/packages/google_maps_flutter
But the issue is still the same if i drag map it shows the map again else shows blank screen, will add the code here and every detail
Lib versions -
google_maps_flutter: ^2.2.3
google_maps_flutter_web: ^0.4.0+5

issue video link
https://drive.google.com/file/d/1P0mbLxtyF13iR5u8u2s66VuKKvolYeE_/view?usp=sharing

Steps:-
opening this sample screen from another screen on button click

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

class MapSample extends StatefulWidget {
  const MapSample({Key? key}) : super(key: key);

  @override
  State<MapSample> createState() => MapSampleState();
}

class MapSampleState extends State<MapSample> {
  final Completer<GoogleMapController> _controller =
  Completer<GoogleMapController>();

  static const CameraPosition _kGooglePlex = CameraPosition(
    target: LatLng(37.42796133580664, -122.085749655962),
    zoom: 14.4746,
  );

  static const CameraPosition _kLake = CameraPosition(
      bearing: 192.8334901395799,
      target: LatLng(37.43296265331129, -122.08832357078792),
      tilt: 59.440717697143555,
      zoom: 19.151926040649414);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: Icon(Icons.arrow_back),
          onPressed: () => Navigator.of(context).pop(),
        ),
        title: Text('Sample'),
        actions: <Widget>[],
      ),
      body: GoogleMap(
        mapType: MapType.hybrid,
        initialCameraPosition: _kGooglePlex,
        onMapCreated: (GoogleMapController controller) {
          _controller.complete(controller);
        },
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: _goToTheLake,
        label: const Text('To the lake!'),
        icon: const Icon(Icons.directions_boat),
      ),
    );
  }

  Future<void> _goToTheLake() async {
    final GoogleMapController controller = await _controller.future;
    controller.animateCamera(CameraUpdate.newCameraPosition(_kLake));
  }
}

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 9, 2023
@huycozy
Copy link
Member

huycozy commented Feb 9, 2023

Hi @raman-kumar-ha
I see that your demo video is different from the result when I run your sample code. Please provide the complete sample code showing the error as shown in your demo video.
Below is the result when running above sample code:

Screen.Recording.2023-02-09.at.18.58.52.mov

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 9, 2023
@raman-kumar-ha
Copy link
Author

@huycozy can you just use my sample code in your project, also open the screen from button click so that you can open it again and check the issue?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 10, 2023
@huycozy
Copy link
Member

huycozy commented Feb 10, 2023

@raman-kumar-ha It's loading fine with below sample code after I adding the page navigation. I can see the grey color loading but it's only displayed immediately.

Screen.Recording.2023-02-10.at.19.15.58.mov
Sample code
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

void main() {
  runApp(
    MaterialApp(
      title: 'Named Routes Demo',
      // Start the app with the "/" named route. In this case, the app starts
      // on the FirstScreen widget.
      initialRoute: '/',
      routes: {
        // When navigating to the "/" route, build the FirstScreen widget.
        '/': (context) => const FirstScreen(),
        // When navigating to the "/second" route, build the SecondScreen widget.
        '/second': (context) => const MapSample(),
      },
    ),
  );
}

class FirstScreen extends StatelessWidget {
  const FirstScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('First Screen'),
      ),
      body: Center(
        child: ElevatedButton(
          // Within the `FirstScreen` widget
          onPressed: () {
            // Navigate to the second screen using a named route.
            Navigator.pushNamed(context, '/second');
          },
          child: const Text('Launch screen'),
        ),
      ),
    );
  }
}


class MapSample extends StatefulWidget {
  const MapSample({Key? key}) : super(key: key);

  @override
  State<MapSample> createState() => MapSampleState();
}

class MapSampleState extends State<MapSample> {
  final Completer<GoogleMapController> _controller =
  Completer<GoogleMapController>();

  static const CameraPosition _kGooglePlex = CameraPosition(
    target: LatLng(37.42796133580664, -122.085749655962),
    zoom: 14.4746,
  );

  static const CameraPosition _kLake = CameraPosition(
      bearing: 192.8334901395799,
      target: LatLng(37.43296265331129, -122.08832357078792),
      tilt: 59.440717697143555,
      zoom: 19.151926040649414);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back),
            onPressed: () => Navigator.of(context).pop(),
          ),
          title: Text('Sample'),
          actions: <Widget>[],
        ),
        body: GoogleMap(
          mapType: MapType.hybrid,
          initialCameraPosition: _kGooglePlex,
          onMapCreated: (GoogleMapController controller) {
            _controller.complete(controller);
          },
        ),
        floatingActionButton: FloatingActionButton.extended(
          onPressed: _goToTheLake,
          label: const Text('To the lake!'),
          icon: const Icon(Icons.directions_boat),
        ),
      ),
    );
  }

  Future<void> _goToTheLake() async {
    final GoogleMapController controller = await _controller.future;
    controller.animateCamera(CameraUpdate.newCameraPosition(_kLake));
  }
}

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 10, 2023
@raman-kumar-ha
Copy link
Author

@huycozy did you try coming back to map screen again and again , it is working fine ? No grey screen found?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 13, 2023
@huycozy
Copy link
Member

huycozy commented Feb 14, 2023

@raman-kumar-ha Thanks for pointing out that.

Issue investigation

  • When navigating back and forth Google Maps screen several times, the grey screen appears instead of the map. But it can be rendered right after resizing the browser window.
  • The issue only appears when navigating from another screen. When the map screen is loaded as the first screen, the issue doesn't occur.
  • And it's only happening on Safari browser, including the error log from the console.

Demo

Safari ❌ Chrome ✅
safari.mov
chrome.mov

✅: No Issue ❌: Issue reproduced

Error logs
Error from backend:

Error: Bad state: Not connected to an application.

Stack Trace:
#0      DevHandler._handleConnection.<anonymous closure> (package:dwds/src/handlers/dev_handler.dart:272:13)
#1      _rootRunUnary (dart:async/zone.dart:1406:47)
#2      _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#6      _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)
#7      _MapStream._handleData (dart:async/stream_pipe.dart:218:10)
#8      _rootRunUnary (dart:async/zone.dart:1414:13)
#9      _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#10     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#11     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#12     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#13     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#14     _StreamController._add (dart:async/stream_controller.dart:648:7)
#15     _StreamController.add (dart:async/stream_controller.dart:596:5)
#16     new WebSocketImpl.fromSocket.<anonymous closure> (package:web_socket_channel/src/copy/web_socket_impl.dart:730:21)
#17     _rootRunUnary (dart:async/zone.dart:1406:47)
#18     _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#19     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#20     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#21     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#22     _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)
#23     _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)
#24     _WebSocketProtocolTransformer._messageFrameEnd (package:web_socket_channel/src/copy/web_socket_impl.dart:319:23)
#25     _WebSocketProtocolTransformer.add (package:web_socket_channel/src/copy/web_socket_impl.dart:218:46)
#26     _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
#27     _rootRunUnary (dart:async/zone.dart:1406:47)
#28     _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#29     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#30     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#31     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#32     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#33     _StreamController._add (dart:async/stream_controller.dart:648:7)
#34     _StreamController.add (dart:async/stream_controller.dart:596:5)
#35     _Socket._onData (dart:io-patch/socket_patch.dart:2353:41)
#36     _rootRunUnary (dart:async/zone.dart:1414:13)
#37     _CustomZone.runUnary (dart:async/zone.dart:1307:19)
#38     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
#39     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
#40     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
#41     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
#42     _StreamController._add (dart:async/stream_controller.dart:648:7)
#43     _StreamController.add (dart:async/stream_controller.dart:596:5)
#44     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1871:33)
#45     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1328:14)
#46     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#47     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#48     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:123:13)
#49     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)
Sample code
import 'dart:async';

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';

void main() {
  runApp(
    MaterialApp(
      title: 'Named Routes Demo',
      // Start the app with the "/" named route. In this case, the app starts
      // on the FirstScreen widget.
      initialRoute: '/',
      routes: {
        // When navigating to the "/" route, build the FirstScreen widget.
        '/': (context) => const FirstScreen(),
        // When navigating to the "/second" route, build the SecondScreen widget.
        '/second': (context) => const MapSample(),
      },
    ),
  );
}

class FirstScreen extends StatelessWidget {
  const FirstScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('First Screen'),
      ),
      body: Center(
        child: ElevatedButton(
          // Within the `FirstScreen` widget
          onPressed: () {
            // Navigate to the second screen using a named route.
            Navigator.pushNamed(context, '/second');
          },
          child: const Text('Launch screen'),
        ),
      ),
    );
  }
}


class MapSample extends StatefulWidget {
  const MapSample({Key? key}) : super(key: key);

  @override
  State<MapSample> createState() => MapSampleState();
}

class MapSampleState extends State<MapSample> {
  final Completer<GoogleMapController> _controller =
  Completer<GoogleMapController>();

  static const CameraPosition _kGooglePlex = CameraPosition(
    target: LatLng(37.42796133580664, -122.085749655962),
    zoom: 14.4746,
  );

  static const CameraPosition _kLake = CameraPosition(
      bearing: 192.8334901395799,
      target: LatLng(37.43296265331129, -122.08832357078792),
      tilt: 59.440717697143555,
      zoom: 19.151926040649414);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          leading: IconButton(
            icon: Icon(Icons.arrow_back),
            onPressed: () => Navigator.of(context).pop(),
          ),
          title: Text('Sample'),
          actions: <Widget>[],
        ),
        body: GoogleMap(
          mapType: MapType.hybrid,
          initialCameraPosition: _kGooglePlex,
          onMapCreated: (GoogleMapController controller) {
            _controller.complete(controller);
          },
        ),
        floatingActionButton: FloatingActionButton.extended(
          onPressed: _goToTheLake,
          label: const Text('To the lake!'),
          icon: const Icon(Icons.directions_boat),
        ),
      ),
    );
  }

  Future<void> _goToTheLake() async {
    final GoogleMapController controller = await _controller.future;
    controller.animateCamera(CameraUpdate.newCameraPosition(_kLake));
  }
}
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.7.3 on channel stable at /Users/huynq/Documents/GitHub/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (17 hours ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Users/huynq/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.75.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (3 available)
    • SM T225 (mobile) • R9JT3004VRJ • android-arm64  • Android 13 (API 33)
    • macOS (desktop)  • macos       • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)     • chrome      • web-javascript • Google Chrome 110.0.5481.77

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.8.0-12.0.pre.49, on macOS 13.0.1 22A400 darwin-x64, locale en-VN)
    • Flutter version 3.8.0-12.0.pre.49 on channel master at /Users/huynq/Documents/GitHub/flutter_master
    ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b08cc8be79 (45 minutes ago), 2023-02-13 22:36:26 -0500
    • Engine revision c4f51bc786
    • Dart version 3.0.0 (build 3.0.0-233.0.dev)
    • DevTools version 2.21.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/huynq/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/huynq/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] IntelliJ IDEA Community Edition (version 2022.1.1)
    • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.75.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.0.1 22A400 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 110.0.5481.96

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

@huycozy huycozy added p: maps Google Maps plugin platform-web Web applications specifically package flutter/packages repository. See also p: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on browser: safari-macos only manifests in Safari on macOS found in release: 3.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 and removed in triage Presently being triaged by the triage team labels Feb 14, 2023
@stuartmorgan stuartmorgan added the P2 Important issues not at the top of the work list label Feb 14, 2023
@stuartmorgan
Copy link
Contributor

/cc @ditman FYI

@ditman
Copy link
Member

ditman commented Feb 16, 2023

This is odd, note that the map is rendering the warning that "This page can't load Google Maps correctly." without problems.

I've only seen this issue when the google maps attempts to render in a 0x0/invisible div. There seems to be a race condition with the navigation and the rendering of the map widget (or maybe it's because we're caching an old one).

Unsure! I'll take a look though!

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-web Owned by Web platform team triaged-web Triaged by Web platform team labels Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: safari-macos only manifests in Safari on macOS found in release: 3.7 Found to occur in 3.7 found in release: 3.8 Found to occur in 3.8 has reproducible steps The issue has been confirmed reproducible and is ready to work on p: maps Google Maps plugin P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

No branches or pull requests

6 participants