-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update for the overlay builder #713
base: master
Are you sure you want to change the base?
Conversation
@@ -390,6 +393,9 @@ class ChewieController extends ChangeNotifier { | |||
|
|||
static const defaultHideControlsTimer = Duration(seconds: 3); | |||
|
|||
/// Define here your own Widget on how your overlay will look | |||
Widget Function(BuildContext context)? overlayBuilder; |
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.
This should be final
since we're trying to make the controller immutable.
if(chewieController.overlayBuilder != null) { | ||
return chewieController.overlayBuilder!(context); | ||
} | ||
if (chewieController.overlay != null) { | ||
return chewieController.overlay!; | ||
} | ||
return const SizedBox.shrink(); |
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.
This should be chained as an if-else statement, with it defaulting to SizedBox.shrink()
.
For bonus credit, instead of using a function to compute the correct Widget to return, why not move it into a standalone widget that takes in the current controller and computes it when build
is called on it.
@murphycrosby if you have the time to work on the requested changes, then I'll be able to review them. Thanks in advance. |
#665