diff --git a/lib/src/tutorial_view.dart b/lib/src/tutorial_view.dart index 0eb3040..cea3006 100644 --- a/lib/src/tutorial_view.dart +++ b/lib/src/tutorial_view.dart @@ -48,6 +48,7 @@ class _TutorialViewState extends State { @override Widget build(BuildContext context) { if (messages.isEmpty) { + controller.dispose(); Navigator.pop(context); return const SizedBox.shrink(); } @@ -62,7 +63,7 @@ class _TutorialViewState extends State { behavior: HitTestBehavior.opaque, onTap: () { controller.dismiss(); - setState(() {}); + if (mounted) setState(() {}); }, child: PopScope( canPop: false,