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

Update for the overlay builder #713

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

murphycrosby
Copy link

@@ -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;
Copy link
Collaborator

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.

Comment on lines +24 to +30
if(chewieController.overlayBuilder != null) {
return chewieController.overlayBuilder!(context);
}
if (chewieController.overlay != null) {
return chewieController.overlay!;
}
return const SizedBox.shrink();
Copy link
Collaborator

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.

@diegotori
Copy link
Collaborator

@murphycrosby if you have the time to work on the requested changes, then I'll be able to review them.

Thanks in advance.

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