Skip to content

Google Maps onCameraIdle not working in iOS when in a Stack. #33988

@leen-nobbas

Description

@leen-nobbas

Steps to Reproduce

I have a layout where in a Stack I have a GoogleMap, a GestureDetector on top of it that currently absorbs all the taps and doesn't pass it to the GoogleMap. Once tapped, GestureDetector allows the taps to be passed onto GoogleMap.
Problem is, whenever I make this kind of layout, the onCameraIdle callback is not being called in iOS (works in Android). Double tapping the map or tapping on a marker somehow resets the callback, but it doesn't work the first time.

class FancyMapPageState extends State<FancyMapPage> {

  ...

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: <Widget>[
        GoogleMap(
        ...
        ),
        GestureDetector(
          behavior: !_animationController.isCompleted
              ? HitTestBehavior.opaque
              : HitTestBehavior.deferToChild,
          onTap: () {
            _animationController.forward();
          },
        ),
        SlideTransition(
          position: _cardSlideAnimation,
          Container(
            child: ...,
          ),
        ),
      ],
    );
  }
}

Logs

No issues found! (ran in 5.9s)
[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-IN)
    • Flutter version 1.5.4-hotfix.2 at /Users/gurleensethi/Documents/Flutter/flutter
    • Framework revision 7a4c33425d (5 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/gurleensethi/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] IntelliJ IDEA Community Edition (version 2019.1.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 36.0.4
    • Dart plugin version 191.7830

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

[✓] Connected device (1 available)
    • Gurleen’s iPhone • 2e3ceb53501346b6a4d1b2e0ac2abf9850737cc5 • ios • iOS 12.3.1

• No issues found!

@iskakaushik Could you please look into this, thanks in advance :)

Edit by cyanglaz:
internal b/144584399

Metadata

Metadata

Assignees

Labels

a: platform-viewsEmbedding Android/iOS views in Flutter appscustomer: googleVarious Google teamsp: mapsGoogle Maps pluginpackageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions