-
Notifications
You must be signed in to change notification settings - Fork 939
Added webview scrolling listener #125
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
Conversation
Fix #125 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR, I added some comments
lib/src/base.dart
Outdated
@@ -60,6 +64,8 @@ class FlutterWebviewPlugin { | |||
/// more detail than other events | |||
Stream<WebViewStateChanged> get onStateChanged => _onStateChanged.stream; | |||
|
|||
|
|||
Stream<String> get onScrollChanged => _onScrollChanged.stream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please comments dart API. what is the String value ? could we pass an other object ? yPos, xPos ... ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the streaming value is only "UP" or "DOWN". I can try to change it to stream two integer value tonight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no possibility to scroll horizontally ?
# Conflicts: # android/src/main/java/com/flutter_webview_plugin/WebviewManager.java # example/lib/main.dart # lib/src/base.dart
@lejard-h I have made some changes to the API, there's now two stream event each listen to the horizontal scroll ( onScrollYChanged ) and vertical scroll ( onScrollXChanged ). You can reference the readme for more details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍
Added webview scrolling listener
Added a webview scroll listener, example:
webviewReference.onScrollChanged.listen((String scrollDirection) {
print(scrollDirection);
});