Ensure that the widget is mounted before resetting the state
This commit is contained in:
parent
873f1b631d
commit
38b2c76892
1 changed files with 3 additions and 1 deletions
|
@ -76,7 +76,9 @@ class _VideoWidgetState extends State<VideoWidget> {
|
|||
VideoPlayerController _setVideoPlayerController(String url) {
|
||||
return _videoPlayerController = VideoPlayerController.network(url)
|
||||
..initialize().whenComplete(() {
|
||||
setState(() {});
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue