Skip to content

GestureDetector producing incorrect results when used with UiKitView on iOS 12 and 14 #66097

@nwparker

Description

@nwparker

Steps to Reproduce

  1. Clone my repo of minimal reproducible code
  2. Run on iOS (I've only tried physical devices).
  • Devices I've tried:
    • iPhone6 (iOS 12)
    • iPhoneX (iOS 14)
  1. Wait for app to load (it's a black screen)
  2. Test out gesture detection (it will work as expected)
  3. Put phone in landscape orientation
  4. Pull down notification center (swipe it up and down 2-3 times)
  5. Return to app
  6. Test out gesture detection again (it will not work as expected. Everything becomes a ScaleStart/ScaleEnd)

Expected results:
For gesture to be detected correctly

Actual results:
Incorrect gesture detection. Eventually all gestures become a ScaleStart/ScaleEnd

Other Info:
The offending code is simple enough to paste here (requires setting up a PlatformView which I've done for you in my repo):

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return  GestureDetector(
        onTap: () => print("onTap"),
        onDoubleTap: () => print("onDoubleTap"),
        onScaleStart: (_) => print("onScaleStart"),
        onScaleEnd: (_) => print("onScaleEnd"),
        child: UiKitView(viewType: "dummyView", onPlatformViewCreated: (int i) => print("UiKitView dummyView created"))
    );
  }
}
Logs
# Shows nothing useful, and makes my post too long for github to accept. Omitting.
Analyzing gesturebug...                                                 
No issues found! (ran in 1.7s)
[✓] Flutter (Channel stable, 1.20.4, on Mac OS X 10.15.6 19G2021, locale en-US)
    • Flutter version 1.20.4 at /Users/jose/projects/flutter
    • Framework revision fba99f6cf9 (3 days ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/jose/Library/Android/sdk
    • Platform android-29, build-tools 29.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_242-release-1644-b3-6222593)
    • All Android licenses accepted.

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

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

Metadata

Metadata

Assignees

Labels

a: platform-viewsEmbedding Android/iOS views in Flutter appsf: gesturesflutter/packages/flutter/gestures repository.found in release: 1.20Found to occur in 1.20frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specifically

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions