From 4624b2d943576f152bb7a4177c28c4aff8712579 Mon Sep 17 00:00:00 2001 From: Alexandre Beaujour Date: Fri, 29 Mar 2024 15:26:08 -0400 Subject: [PATCH] Update README.md --- example/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/example/README.md b/example/README.md index 84b8a41..43e4013 100644 --- a/example/README.md +++ b/example/README.md @@ -56,7 +56,9 @@ class _MyHomePageState extends State { // values only when widget is visible child: VisibilityDetector( onVisibilityChanged: (VisibilityInfo info) { - visible = info.visibleFraction > 0; + if (context.mounted) { + visible = info.visibleFraction > 0; + } }, key: Key('visible-detector-key'), child: BarcodeKeyboardListener(