feat: add content property to Video control#6392
feat: add content property to Video control#6392bl1nch wants to merge 6 commits intoflet-dev:release/v0.85.0from
Conversation
|
That is a really cool feature! Thanks for the PR :) |
|
Change PR base branch to
|
18ea9dd to
1f7a0e1
Compare
| def init(self): | ||
| super().init() | ||
| self._internals["host_expanded"] = True | ||
|
|
There was a problem hiding this comment.
Why do we need this?
| if (content != null) { | ||
| return Column( | ||
| mainAxisAlignment: MainAxisAlignment.start, | ||
| crossAxisAlignment: CrossAxisAlignment.start, |
There was a problem hiding this comment.
I'm not sure hard-coded column wrapper is a good idea. I'd leave content a generic control and let user decide what to put there.
There was a problem hiding this comment.
The problem is that media_kit forces any widget passed to controls to expand and stretches it to the full area of the player. I thought it would be better to wrap content in a Column before passing it to controls. This way, we create a feeling that the Video control itself is like a separate View.
self._internals["host_expanded"] = True is used so that the widget passed to content supports expand=True, but it is not mandatory for it.
What do you think about this?
|
Could you fix a merge conflict please. |
Description
This PR adds a content property to the Video control. It allows developers to replace the standard media_kit playback controls with a custom Flet control (e.g., a Container, Stack, or Row with custom buttons/text/other controls).
Test Code
Type of change
Checklist
Screenshots
Additional details
Summary by Sourcery
Add support for custom content in the Video control and provide an example usage.
New Features:
Documentation: