use_build_context_synchronously
"message": "Don't use 'BuildContext's across async gaps.\nTry rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check.",
This commit is contained in:
parent
ae1db05f04
commit
1b16573b06
1 changed files with 4 additions and 2 deletions
|
|
@ -54,8 +54,10 @@ class _MangaWebViewState extends ConsumerState<MangaWebView> {
|
|||
..setBrightness(Brightness.dark)
|
||||
..launch(widget.url)
|
||||
..onClose.whenComplete(() {
|
||||
timer.cancel();
|
||||
Navigator.pop(context);
|
||||
if (mounted) {
|
||||
timer.cancel();
|
||||
Navigator.pop(context);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue