-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
CustomScrollView + SliverAppBar + WebView #31243
Comments
I also have the same issue. But for me the full page article is not shown and gets cut off especially if you reload the page. |
Yup that's exactly what's happening.
|
I just tested with the |
partial solution in my repo I will share my view here repeating what I wrote in my answer in stackoverflow may be it can help providing a solution I can give you my view for why it is not possible to do that with the current state of the plugin ,by default the Webview only respond to drag gesture when no other views claim that gesture. On the other hand, Scrolling slivers like SliverList, which is needed to make the SliverAppBar to scroll up ,by default consumes all drag scrolling gestures -although you can disable that by providing noScrollPhysics - but once the WebView cover all the screen there is actually noway to report back to the slivers to start consume scroll again . So the solution is to modify the WebView plugin itself to provide a callback I already did that just for a proof of concept you can check my repo Plugins by adding a new callback to the webView just to make it clear it works only for android api M or above right now |
the same issue.
|
Same issues in here. I try 3 plugin webview. But can't use sliverappbar. My app cant scroll. |
same issue + 1 |
same issue:NestedScrollView + SliverAppBar + WebView |
To anyone following this issue, I'm getting into this, and will try to add some more information in a near future (hopefully, if I could understand it). Meantime, the pending POC commit of @Reekoooo (see above) : Reekoooo/plugins@666b35f Gesture arena of a valid use case
Gesture arena of a invalid use case (partial HTML, then cut or infinite height)
Scroll on SliverAppBar area from a screen with Webview using a
Scroll on the webview area from a screen with Webview using a
Scroll wherever in the screen (SliverAppBar or body) from a screen with SliverGrid
Next things to investigate for me Please advise if it is not the right approach. |
By the way, I've had NestedScrollView + SliverAppBar + WebView previously, and I recently moved to CustomScrollView + SliverAppBar + WebView because it would crash in release builds only. Please see #30247 (comment) for more information |
@iskakaushik, @amirh : is this also a known performance issue that will be solved once the thread-merging work is done for the WebView? |
@liyuqian Is this a PR you are referencing that we can follow up upon? |
This affects all platform views, not just webview. I expect that At a first glance I was going to say that it seems like the way we detect whether or not we should resize is broken, but I think there may be some complexity here with |
This other webview plugin https://pub.dev/documentation/flutter_inappbrowser/latest/ has a scroll callback that works on both iOS and Android, similarly to @reekoo Android PoC for webview_flutter. Not sure if it works inside a NestedScrollView though to achieve the behavior that's attempted here. Currently I have a setup where I just change the height of a top bar manually from the scroll callbacks of the InAppWebView. To solve the performance issue described here from resizing the webview, I made the webview constant size instead, with the top bar covering part of it in a Stack. This was possible because I'm showing a partially customized web page where I can add a top padding matching the covered-up part. |
Any updates on this ? I am having the same issue. |
I am having the same issue, Please fix the bug that webview will resizing itself and out the boundary of itself |
same problem here |
same problem with me ... please give us any solution |
The performance issue seems to be fixed by hybrid composition, although there's a separate issue with the gesture disambiguation that I'm trying to figure out. |
@yjbanov this is the type of issues where having declarative gesture disambiguation would simplify or eliminate most of our current hacks. |
This has been fixed in Flutter 1.22/ WebView 1.0 - use hybrid composition in the Flutter WebView plugin. https://github.com/flutter/plugins/tree/master/packages/webview_flutter#using-hybrid-composition |
@blasten before this update I achieved this functionality by injecting some js into the webview content to detect the scroll direction into the html content and by listening if the body top was visible then I changed the gestureRecognizers according to those events(exmaple:https://www.facebook.com/1792131602/videos/10213309766977319/ ) but It seems this update doesn't fix that or am I missing something? best regards
using: Flutter 1.22.2 • channel stable • https://github.com/flutter/flutter.git |
Still the issue not fixed!! using Flutter 1.22.3 and flutter_webview 1.0.7 with enabling the Hybrid Composition on every layout possible:
The current behavior: is scrolling only the app bar height and stop scrolling in the webpage after!! [✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.14.5 18F132, locale en-EG)
• Flutter version 1.22.3 at /Users/esham/Development/flutter
• Framework revision 8874f21e79 (2 weeks ago), 2020-10-29 14:14:35 -0700
• Engine revision a1440ca392
• Dart version 2.10.3
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/esham/Library/Android/sdk
• Platform android-30, build-tools 29.0.2
• ANDROID_HOME = /Users/esham/Library/Android/sdk
• ANDROID_SDK_ROOT = /Users/esham/Library/Android/sdk
• 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)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 39.0.3
• Dart plugin version 191.8423
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (1 available)
• Redmi Note 8 Pro (mobile) • hev4t4bqo7hyvsnf • android-arm64 • Android 10 (API 29) |
@blasten When you say fixed, more specifically what is fixed? In 1.22.4, with hybrid composition, you cannot use a CustomScrollView with a SliverAppBar and then a SliverFillRemaining with a webview. The webview just won't scroll |
This bug indeed still exists and not fixed yet!! I can't scroll on the webview itself and the sliverappbar even is glitchy, that in the latest version on flutter 1.22.4
|
Hey team, any update on this or should we create another issue to track this? I tried it out with the new Hybrid Composition awhile back and that didn't seem to work. There is a new issue at #72888 but I believe that's a different issue. The original problem as reported in this issue is to have a SliverAppBar + a WebView, and that scrolling on the WebView should collapse the SliverAppBar. The code example and a GIF that accompanies it describes it pretty well. |
This issue is about the scroll performance while having (a) a platform view and (b) a I hear that it would be useful to have an example that deals with other issues:
I'd love to hear if any of you would be interested in sending a PR to the WebView plugin example app that accomplishes exactly this. Some ideas about how to approach it:
|
I guess the best solution I came up with for now is:
Here is quick snippet for illustration: https://gist.github.com/emvaized/fa1ce586109196d7357652de2843b8ff However, it has issues — for example app bar jumps back and forth when finger movement is very slow. Also animation is choppy sometimes. |
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 |
Hi,
When trying to implement a floating
SliverAppBar
in conjunction with aWebView
Flutter drops a significant amount of frames.It seems like the WebView is resizing itself whenever the
SliverAppBar
is scrolled out of view.As seen on this GIF:
The text was updated successfully, but these errors were encountered: