Open ThatPham2000 opened 5 months ago
Hi @ThatPham2000, you are using an old version of flutter. Kindly upgrade to the latest version of flutter. Kindly upgrade to the latest version of flutter stable (3.19.5) to see if you still experience this issue.
If you do, please provide the updated output of flutter doctor -v
Thank you
Because of https://github.com/flutter/flutter/issues/141007, we have to use the above version. However, I updated the latest version 3.19.5. The result is the same. onDoubleTap has never called. Here is my flutter doctor:
[✓] Flutter (Channel stable, 3.19.5, on macOS 13.6.1 22G313 darwin-arm64, locale
en-VN)
• Flutter version 3.19.5 on channel stable at
/Users/phat/Developer/flutter_3.19.5
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 300451adae (4 days ago), 2024-03-27 21:54:07 -0500
• Engine revision e76c956498
• Dart version 3.3.3
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/phat/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = /Users/phat/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.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
17.0.6+0-17.0.6b829.9-10027231)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4)
• IntelliJ at /Applications/IntelliJ IDEA.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.87.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.6.1 22G313
darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87
[✓] Network resources
• All expected network resources are available.
• No issues found!
Hi @ThatPham2000, just to confirm, does this work if the magnification shortcut
is not set to a triple tap
?
Hi @danagbemava-nc , You are right.
Hi @ThatPham2000, are you able to use the gesture properly in native android apps?
Can you also share some examples?
Hi @danagbemava-nc , For this issue, the root cause is that users turn on the magnification shortcut with the triple-tap feature. Magnification is one of the Accessibility features. Because Accessibility's triple-tap has the same behavior as the double-tap of Flutter, Flutter's onDoubleTap function has never been called. Besides, I tested it on iOS. iOS used a double-tap with three fingers to trigger the magnification. After enabling magnification, the feature works fine. I provided the code example causing this issue above.
Hi @ThatPham2000, my apologies, I wasn't clear enough.
What I meant was in native android, do you see the gesture being handled properly while the magnification is active? I ask this because of the system is intercepting the triple tap to show the magnifier, there likely isn't a way for flutter to handle the event because it won't be receiving them. I tested a small example in jetpack compose but the system was intercepting the event so the double tap wasn't working. If you could provide an example in native android that works as expected, we would appreciate it, otherwise there wouldn't be much we can do.
PS: Android and iOS have different ways of handling things internally, so things that work on iOS may not always work on android
Hi @danagbemava-nc , here is the video example. At the end of the video (1:04), you can see when you enable the magnification, Flutter still recognizes the double-tap action (very lucky ^^ after a long time of trying). Therefore, it is very hard to detect the double-tap action. Can Flutter override this?
https://github.com/flutter/flutter/assets/57900109/15377382-deaa-4161-b91f-463b27ef33dd
@ThatPham2000, thanks for the video, I initially assumed that Talkback needed to be on for this to be reproduced.
Reproducible using the code sample provided above.
Talkback should not be on to reproduce this issue. I tested with a compose sample and it works as expected. With the magnification gesture set to triple tap, it seems like the gesture detector captures the input as a single tap instead of a double tap. A triple tap will end up triggering magnification on the device.
flutter | compose |
---|---|
Steps to reproduce
Click the text or the number. P/s: after enabling the magnification shortcut with triple tap, I was unable to double tap.
Expected results
Number will increase
Actual results
Nothing happened
Code sample
Code sample
```dart import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({super.key}); @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, ), home: const MyHomePage(title: 'Flutter Demo Home Page'), ); } } class MyHomePage extends StatefulWidget { const MyHomePage({super.key, required this.title}); final String title; @override StateScreenshots or Video
Screenshots / Video demonstration
![Screenshot](https://github.com/flutter/flutter/assets/57900109/9e66cfa7-5e59-4145-966a-39ce5fca0b0e)Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.13.2, on macOS 13.6.1 22G313 darwin-arm64, locale en-VN) • Flutter version 3.13.2 on channel stable at /Users/phat/Developer/flutter_3.13.2 • Upstream repository https://github.com/flutter/flutter.git • Framework revision ff5b5b5fa6 (7 months ago), 2023-08-24 08:12:28 -0500 • Engine revision b20183e040 • Dart version 3.1.0 • DevTools version 2.25.0 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/phat/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/phat/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15A507 • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.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 17.0.6+0-17.0.6b829.9-10027231) [✓] IntelliJ IDEA Ultimate Edition (version 2023.1.4) • IntelliJ at /Applications/IntelliJ IDEA.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.87.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter [✓] Connected device (3 available) • SM F926B (mobile) • RFCT426NC0B • android-arm64 • Android 14 (API 34) • macOS (desktop) • macos • darwin-arm64 • macOS 13.6.1 22G313 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.87 [✓] Network resources • All expected network resources are available. • No issues found! ```