Skip to content
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

feat: Add onDragDown to Miniplayer #33

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dr-Blank
Copy link

the notifier is there, this just makes it possible to be supplied from parent like the height notifier.

Use case: Control the volume of the media player like youtube does.

@dxvid-pts
Copy link
Owner

dxvid-pts commented May 16, 2024

Thank you for your contribution! Looking at this in retroperspective it makes more sense to add a callback function instead of a custom valuenotifier. Then call the callback by listening to the exisiting (private) notifier.

E.g Function onDragDown(double dragDownPercentage); to be able to use

Miniplayer(
    onDragDown: (percentage){
        ...
    },
);

@Dr-Blank
Copy link
Author

Thank you for your contribution! Looking at this in retroperspective it makes more sense to add a callback function instead of a custom valuenotifier. Then call the callback by listening to the exisiting (private) notifier.

E.g Function onDragDown(double dragDownPercentage); to be able to use

Miniplayer(
    onDragDown: (percentage){
        ...
    },
);

sure, I can make the change

@Dr-Blank Dr-Blank force-pushed the feat-notifier-for-percent-dismissed branch from f4c741d to cd6c049 Compare May 18, 2024 11:11
@Dr-Blank Dr-Blank changed the title feat: Add dragDownPercentageValueNotifier to Miniplayer feat: Add onDragDownPercentageChange to Miniplayer May 18, 2024
@Dr-Blank Dr-Blank force-pushed the feat-notifier-for-percent-dismissed branch from cd6c049 to 234a87e Compare May 18, 2024 11:15
@Dr-Blank Dr-Blank changed the title feat: Add onDragDownPercentageChange to Miniplayer feat: Add onDragDown to Miniplayer May 18, 2024
@Dr-Blank
Copy link
Author

@dxvid-pts

I have made the changes. Please review.

@dxvid-pts
Copy link
Owner

Hi, the listener returned by .addListener needs to be disposed in onDispose (not disposing leads to memory leaks I think). Other than that it's good to go!

@Dr-Blank
Copy link
Author

Dr-Blank commented May 21, 2024

Hi, the listener returned by .addListener needs to be disposed in onDispose (not disposing leads to memory leaks I think). Other than that it's good to go!

good catch.

480f793 should fix this.

according to the docs disposing the notifier should only be done by the owner and doing so will remove any listeners, hence I did it this way since this notifier was created by this widget. please let me know if this is not what you had in mind.

...This method should only be called by the object's owner...
...and clears the listener list once it is called...

@Dr-Blank
Copy link
Author

Hey @dxvid-pts, just checking in to see if there's anything I can do to help move things forward. It seems you might not have received my last message, so I wanted to make sure you get this one. No pressure at all—I understand how busy things can get, so feel free to ignore this if you're tied up. Thanks!

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