-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Scrolling with physical mouse is super slow on Android #82973
Comments
Hi @selvam920 I can reproduce the keyboard issuePreview
Reproduced the issue using the following minimal code sample minimal code sampleimport 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Center(
child: TextField(),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
);
}
}
This seems to be too fixed on the Reproduced on the following channels
Check flutter doctor -v[✓] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.0 at C:\Users\Taha\Code\flutter_stable
• Framework revision b22742018b (6 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java.exe
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[✓] IntelliJ IDEA Community Edition (version 2021.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
• 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.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (4 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
! Doctor found issues in 1 category. [✓] Flutter (Channel beta, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.0 at C:\Users\Taha\Code\flutter_beta
• Framework revision b22742018b (6 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java.exe
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[✓] IntelliJ IDEA Community Edition (version 2021.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
• 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.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (4 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
! Doctor found issues in 1 category. [✓] Flutter (Channel dev, 2.3.0-12.1.pre, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.3.0-12.1.pre at C:\Users\Taha\Code\flutter_dev
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f9c825981c (2 days ago), 2021-05-18 14:07:52 -0700
• Engine revision 26e217e6c3
• Dart version 2.14.0 (build 2.14.0-edge.a527411e5100a0a4f48c4009087a1b988aa784af)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 4.2.0)
• Android Studio at C:\Users\Taha\Code\android-studio
• 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.8+10-b944.6842174)
[✓] IntelliJ IDEA Community Edition (version 2021.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
• 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.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (5 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Windows (UWP) (desktop) • winuwp • windows-uwp-x64 •
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
• No issues found! [✓] Flutter (Channel master, 2.3.0-13.0.pre.59, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.3.0-13.0.pre.59 at C:\Users\Taha\Code\flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 1e35f4c0c6 (8 hours ago), 2021-05-20 03:14:01 -0400
• Engine revision 67c537d41b
• Dart version 2.14.0 (build 2.14.0-129.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 4.2.0)
• Android Studio at C:\Users\Taha\Code\android-studio
• 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.8+10-b944.6842174)
[✓] IntelliJ IDEA Community Edition (version 2021.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1.1
• 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.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (5 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Windows (UWP) (desktop) • winuwp • windows-uwp-x64 •
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
• No issues found! ✅ : Reproducible ❌: Not Reproducible Can you please upgrade to the latest but I am not sure what's the mouse issue you're describing, please explain the mouse issue |
The mouse issue is like scroll by mouse wheel up and down the page is not moving smooth, |
Hi @selvam920 I can now also reproduce the mouse No matter how fast I scroll, scrolling is slow as a snail on Android when using a Bluetooth mouse Reproduced the issue using the following minimal code sample minimal code sampleimport 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
theme: ThemeData.dark(),
home: Home(),
);
}
}
class Home extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Material App Bar'),
),
body: Center(
child: ListView.builder(
itemCount: 20,
itemBuilder: (BuildContext context, int index) {
return FlutterLogo(
size: 300,
style: FlutterLogoStyle.horizontal,
);
},
),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {},
),
);
}
}
Reproduced on the following channels
Check flutter doctor -v[✓] Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.2.0 at C:\Users\Taha\Code\flutter_stable
• Framework revision b22742018b (6 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java.exe
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
[✓] VS Code (version 1.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (4 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
! Doctor found issues in 1 category. [✓] Flutter (Channel master, 2.3.0-13.0.pre.87, on Microsoft Windows [Version 10.0.19042.985], locale en-US)
• Flutter version 2.3.0-13.0.pre.87 at C:\Users\Taha\Code\flutter_master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4d6a925326 (4 hours ago), 2021-05-21 01:09:02 -0400
• Engine revision 20260fb95f
• Dart version 2.14.0 (build 2.14.0-134.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Taha\Code\SDK
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\Taha\Code\SDK
• Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31313.79
• Windows 10 SDK version 10.0.19041.0
[✓] Android Studio (version 4.2.0)
• Android Studio at C:\Users\Taha\Code\android-studio
• 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.8+10-b944.6842174)
[✓] VS Code (version 1.56.2)
• VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.22.0
[✓] Connected device (5 available)
• Redmi K20 Pro (mobile) • def0ad20 • android-arm64 • Android 10 (API 29)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19042.985]
• Windows (UWP) (desktop) • winuwp • windows-uwp-x64 •
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.56
|
This may be a case of scroll wheel deltas not wired up correctly. Perhaps not taking into account DPI scaling? cc @gspencergoog |
This issue not only android phone found in android tv, chromebook also |
Tag P4 added this issue, when will it be fixed? |
Any update? This issue is still reproduced at 3.3.0-0.1pre. |
Would be great if this issue and #107400 would get some attention, because now Flutter apps are barely usable on Chrome OS devices. |
Any update in this issue? |
any update on this? |
Is there some sort of workaround we could use to fix this for all lists across the app? We could probably manually listen to the mouse wheel and drive the scroll controller ourselves, but we would need to do that manually for every list in the app. Maybe there is a more straightforward way? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
I recently had a report about our app not supporting proper scrolling with Bluetooth mice. Our app is multi-platform on Windows, Android, ioS, Mac, Linux. I borrowed a BT mouse for testing. I can confirm that Bluetooth mouse support works with our desktop app but with virtually the same code on android, it has the same issue reported here: very slow scroll wheel scrolling problem. I would imagine this was forgotten for Android because it was assumed that the user would use the touch features. However, people connect BT keyboards and mice to tablets all of the time. Our app also supports a desktop mode while rotated in landscape android. We have over 2000 active devices for Android: Furthermore, to be sure it was a flutter problem I downloaded syncfusion (flutter gallery app) and went to the pdf reader sample. This android bt mouse scroll problem also existed. It is therefore a flutter framework problem. |
Seems no one is working with this bug, this bug was created two years ago |
This bug did not close from when i created |
I think you have the power to close. and you have the power to create. The focus of the bug seemed to be diverted to keyboard. I'd close it .. then make a new bug report . If you have the minimum app, then you can explain.. plus you can reference 3 other apps. Your own, mine, and syncfusion. Furthermore, syncfusion and TPR are available on the store. Furthermore, I can confirm that scrolling does work on windows desktop. Lastly, there are 2000 android devices using our TPR app and we have stated a better reason why it is need. Close the issue.. and then make a new one. share the link when you do. |
I will close this bug now, you can create new bug with bug details |
I'd keep this open, it has 15 upvotes which is a core metric the Flutter team uses to determine priority. I know this issue is already on the Flutter teams radar as well. If anything just update the OP to be more clear/specific |
We do look at comments on existing bugs, and filing a new identical bug will not get a different prioritization. I'm sorry this hasn't risen to the top of our queue: there are a lot of other issues to attend to. I'm reopening this because it has a lot of context that would be lost in a new issue (including recent comments). |
Is there any use to reopen this bug? Bcoz this bug we waited almost 2 years |
Yes, in includes investigative work that we won't have to do again when we get to fixing it. It has a reproduction steps and verification, as well as upvotes that will help it get to the top of the queue. There's plenty of reason to keep it open. |
okay.. looks like we got some attention. I hope my information helped. Furthermore, Flutter was quite new then. I would imagine this is one of the issues they would like to solve at this point and tablet as a computer is more common now too. Desktops were in beta back then. I hope we can test a fix for this soon. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
you would need to test and let me know.. However, we did add keyboard scrolling. You can see if that works on android. |
Are you talking about android or desktop? |
You are talking about android.. therefore I'm also saying.. hey you can try testing. I don't have the ability to test without asking for equipment from another monk. If you report back your findings with your own equipment based on android. |
Update I found a solution to this and am working on the unit tests now. It did however expose that flutter takes a few seconds longer than android to register mouse input. I may need to file a different issue to track that work. |
Fixes flutter/flutter#82973 Mouse scroll wheel support for android. I chose to not cache the vertical and horizontal scale factors that come from view configuration. The primary reason is that in the current code path context is only used when the user scrolls which was the unimplemented feature. This smaller blast radius I decided was worth the additional calls. A secondary reason is that when the scale factors are changed is not a well documented path nor is there a lifecycle callback to listen to. Scroll factor is cached on api 25 and below because that more closely mirrors the behavior I see in pre 25 versions of android scroll view. Note flutter takes longer to "see" a mouse that then scrolls than android Fixes #flutter/flutter/82973 Todo list prior to merge ## Links * Some pre api 26 scroll factor code - https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/View.java?q=function:getVerticalScrollFactor%20filepath:android%2Fview%2FView.java&ss=android%2Fplatform%2Fsuperproject%2Fmain - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=930;drc=2fe301db7555bccf53e465436d4cb7442c803df3;bpv=0;bpt=0 * Post api 26 scroll factor code - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=361;drc=406e0f655387f27dda874c2b975fb0ddbd61aa13;bpv=0;bpt=0 - https://developer.android.com/reference/android/view/ViewConfiguration#getScaledVerticalScrollFactor()
@reidbaker Wow, it's great working on master channel |
That is great.. We have an open issue on this. If you can push a note when it goes to the main channel. |
Fixes flutter/flutter#82973 Mouse scroll wheel support for android. I chose to not cache the vertical and horizontal scale factors that come from view configuration. The primary reason is that in the current code path context is only used when the user scrolls which was the unimplemented feature. This smaller blast radius I decided was worth the additional calls. A secondary reason is that when the scale factors are changed is not a well documented path nor is there a lifecycle callback to listen to. Scroll factor is cached on api 25 and below because that more closely mirrors the behavior I see in pre 25 versions of android scroll view. Note flutter takes longer to "see" a mouse that then scrolls than android Fixes #flutter/flutter/82973 Todo list prior to merge ## Links * Some pre api 26 scroll factor code - https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/android/view/View.java?q=function:getVerticalScrollFactor%20filepath:android%2Fview%2FView.java&ss=android%2Fplatform%2Fsuperproject%2Fmain - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=930;drc=2fe301db7555bccf53e465436d4cb7442c803df3;bpv=0;bpt=0 * Post api 26 scroll factor code - https://cs.android.com/android/_/android/platform/frameworks/base/+/main:core/java/android/widget/ScrollView.java;l=361;drc=406e0f655387f27dda874c2b975fb0ddbd61aa13;bpv=0;bpt=0 - https://developer.android.com/reference/android/view/ViewConfiguration#getScaledVerticalScrollFactor()
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 |
When i'm using keyboard and mouse in flutter android app, i found below issue.
i'm using Logitec Keyboard and mouse fo this test.
Same scenario is working fine in windows desktop
Flutter (Channel stable, 2.2.0, on Microsoft Windows [Version 10.0.19043.928], locale en-US)
• Flutter version 2.2.0 at D:\SW\flutter_windows_2.2.0-stable\flutter
• Framework revision b227420 (5 days ago), 2021-05-14 19:12:57 -0700
• Engine revision a9d88a4d18
• Dart version 2.13.0
Related but independent issue: #132866
The text was updated successfully, but these errors were encountered: