Fixes show controls with microtask

This commit is contained in:
Marty Fuhry
2024-03-04 12:36:48 -05:00
parent 0f5c430826
commit 5303bbf6da

View File

@@ -111,7 +111,10 @@ class VideoViewerPage extends HookConsumerWidget {
}
// Hide the controls
ref.read(showControlsProvider.notifier).show = false;
// Done in a microtask to avoid setting the state while the widget is building
Future.microtask(
() => ref.read(showControlsProvider.notifier).show = false,
);
final video = controller.videoPlayerController.value;