Why is the error saying "Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check.
"? Is the mounted getter deprecated?
if (context.mounted) {
pop(context);
}
Why is the error saying "Don't use 'BuildContext's across async gaps, guarded by an unrelated 'mounted' check.
"? Is the mounted getter deprecated?
if (context.mounted) {
pop(context);
}
2
Answers
Now in newer version of flutter you can use
mounted
directly insideStatefulWidget
instead of using
Use
you can check the details when to use
context.mounted
andmounted
here: use_build_context_synchronouslywhenever you need to pass context, try to bind it inside this condition,