Skip to content

Conversation

murphycrosby
Copy link

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