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

Click on floating action button falsely hits underlying map widget #43090

Closed
IdrisN opened this issue Oct 20, 2019 · 3 comments
Closed

Click on floating action button falsely hits underlying map widget #43090

IdrisN opened this issue Oct 20, 2019 · 3 comments
Labels
c: rendering UI glitches reported at the engine/skia rendering level f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. p: maps Google Maps plugin package flutter/packages repository. See also p: labels.

Comments

@IdrisN
Copy link

IdrisN commented Oct 20, 2019

I have a fab on a map widget with an underlying google badge. When tapping on the fab everything seems to work normal.
Upon clicking somewhere on the map again, a tap on the google badge is registered which opens the browser or the google maps app. It seems like when the map widget is tapped again, the initial tap on the filter fab is propagated to the underlying map widget.

In the example below the fab is above the google badge. (This occurs on the iPhone X and newer models but can be fixed by the SafeArea Widget. I left it for demonstration purposes but the problem would occur with underlying markers as well)

Screen-Recording-2019-10-20-at-16 31 32

I have found a similar behaviour in the screen recording provided in issue #29492.
https://drive.google.com/file/d/1jPqCzUDJo--juGoBvn9EtIh8d0BbHrfv/view

Steps to Reproduce

  1. Tap on the filter button (with another underlying widget like the google badge or a marker)
  2. Tap or swipe somewhere on the map

Target Platform: iOS
Target OS version/browser: iOS 12 +

Logs

flutter run --verbose does not produce logs after start.

flutter analyze did not have any issues

[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.6 18G95, locale en-DE)
    • Flutter version 1.9.1+hotfix.4 at /Users/idrisn/libraries/flutter
    • Framework revision cc949a8e8b (3 weeks ago), 2019-09-27 15:04:59 -0700
    • Engine revision b863200c37
    • Dart version 2.5.0


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

[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.1, Build version 11A1027
    • CocoaPods version 1.7.5

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 40.2.2
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

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

[✓] Connected device (1 available)
    • iPhone 11 Pro Max • BC06CE91-131C-43A3-BA0E-4F2405D83C53 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-1
      (simulator)

• No issues found!

This is my widget structure:

// Map Widget
class _MapWidgetState extends State<MapWidget> {
  [...]
  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: Container(
        child: Stack(
          children: <Widget>[
            GoogleMap(
              myLocationEnabled: true,
              mapType: MapType.normal,
              initialCameraPosition: CameraPosition(
                target: widget.initialPosition,
                zoom: 14.4746,
                bearing: 0.0,
              ),
              onMapCreated: (GoogleMapController controller) {
                widget.mapController.complete(controller);
              },
              markers: ...
            ),
            Positioned(
              bottom: 32,
              left: 32,
              child: FilterButton(),
            ),
          ],
        ),
      ),
    );
  }
}

// Filter Fab
class _FilterButtonState extends State<FilterButton>
    with TickerProviderStateMixin {
  Widget build(BuildContext context) {
    return Column(
      ...
      children: <Widget>[
        [...], // filter buttons
        FloatingActionButton(
          heroTag: 'filter-fab',
          mini: true,
          child: AnimatedBuilder(
            animation: _controller,
            builder: (BuildContext context, Widget child) {
              return Transform(
                transform: Matrix4.rotationZ(_controller.value * 2 * pi),
                alignment: FractionalOffset.center,
                child: Icon(
                    _controller.isDismissed ? Icons.filter_list : Icons.done),
              );
            },
          ),
          onPressed: () {
            ...
            setState(() { /** toggle filter fab */ });
          },
        ),
      ]
    ),
  };
}
@iapicca iapicca added f: gestures flutter/packages/flutter/gestures repository. p: maps Google Maps plugin c: rendering UI glitches reported at the engine/skia rendering level labels Oct 21, 2019
@HansMuller HansMuller added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Oct 21, 2019
@TahaTesser
Copy link
Member

Hi @IdrisN
Not able to reproduce this issue, please try this code sample on latest dev channel

Code Sample
import 'dart:async';

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Google Maps Demo',
      home: MapSample(),
    );
  }
}

class MapSample extends StatefulWidget {
  @override
  State<MapSample> createState() => MapSampleState();
}

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

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

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

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: Stack(
        children: [
          GoogleMap(
            mapType: MapType.hybrid,
            initialCameraPosition: _kGooglePlex,
            onMapCreated: (GoogleMapController controller) {
              _controller.complete(controller);
            },
          ),
          Positioned(
            bottom: 32,
            left: 32,
            child: FloatingActionButton(
              mini: true,
              child: Icon(Icons.arrow_back),
              onPressed: () {},
            ),
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton.extended(
        onPressed: _goToTheLake,
        label: Text('To the lake!'),
        icon: Icon(Icons.directions_boat),
      ),
    );
  }

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

flutter doctor -v
[✓] Flutter (Channel dev, 1.20.0-3.0.pre, on Mac OS X 10.15.5 19F101, locale
    en-GB)
    • Flutter version 1.20.0-3.0.pre at /Users/taha/Code/flutter_dev
    • Framework revision 0af027f805 (5 days ago), 2020-07-04 12:19:20 -0700
    • Engine revision a751393804
    • Dart version 2.9.0 (build 2.9.0-20.0.dev 22da8934ac)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/taha/Code/sdk
    • Platform android-30, build-tools 30.0.0
    • ANDROID_HOME = /Users/taha/Code/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.5, Build version 11E608c
    • CocoaPods version 1.9.3

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

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

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

[✓] Connected device (4 available)
    • SM M305F (mobile)      • 32003c30dc19668f          • android-arm64  •
      Android 10 (API 29)
    • Taha’s iPhone (mobile) • 00008020-001059882212002E • ios            • iOS
      13.5.1
    • Web Server (web)       • web-server                • web-javascript •
      Flutter Tools
    • Chrome (web)           • chrome                    • web-javascript •
      Google Chrome 83.0.4103.116

• No issues found!

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 9, 2020
@darshankawar
Copy link
Member

Without additional information we are unfortunately not sure how to resolve this issue.
We are therefore reluctantly going to close this bug for now.
Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

Could everyone who still has this problem please file a new issue with the exact description of 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 related issues.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 30, 2020
@github-actions
Copy link

github-actions bot commented Aug 7, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: rendering UI glitches reported at the engine/skia rendering level f: gestures flutter/packages/flutter/gestures repository. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. p: maps Google Maps plugin package flutter/packages repository. See also p: labels.
Projects
None yet
Development

No branches or pull requests

6 participants