Open Dr-Blank opened 6 months ago
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){
...
},
);
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 useMiniplayer( onDragDown: (percentage){ ... }, );
sure, I can make the change
@dxvid-pts
I have made the changes. Please review.
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!
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.
https://github.com/dxvid-pts/miniplayer/pull/33/commits/480f7933deaf0225ceb3a97162efca53610ba840 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...
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!
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.