Skip to content

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

Merged
merged 6 commits into from
Aug 5, 2018

Conversation

theblackcat102
Copy link
Contributor

Added a webview scroll listener, example:

webviewReference.onScrollChanged.listen((String scrollDirection) {
print(scrollDirection);
});

@theblackcat102
Copy link
Contributor Author

Fix #125

Copy link
Collaborator

@lejard-h lejard-h left a 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

@@ -60,6 +64,8 @@ class FlutterWebviewPlugin {
/// more detail than other events
Stream<WebViewStateChanged> get onStateChanged => _onStateChanged.stream;


Stream<String> get onScrollChanged => _onScrollChanged.stream;
Copy link
Collaborator

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 ... ?

Copy link
Contributor Author

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

Copy link
Collaborator

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 ?

@theblackcat102
Copy link
Contributor Author

@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

Copy link
Collaborator

@lejard-h lejard-h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 👍

@lejard-h lejard-h merged commit 00e6dc9 into fluttercommunity:master Aug 5, 2018
charafau pushed a commit that referenced this pull request Apr 7, 2020
Added webview scrolling listener
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants