This content originally appeared on DEV Community and was authored by sidcode
Don't use 'BuildContext's across async gaps.
Try rewriting the code to not use the 'BuildContext', or guard the use with a 'mounted' check.dartuse_build_context_synchronously
context.mounted
Just wrap the error part with the following. We will process it after confirming the mount.
if (context. mounted) {
if (context.mounted) {
if (isPrayedToday < 1) {
_modalSalatFaithWrite.salatWrite(context, _controller);
} else {
_getShowModalAlreadyToday(context,
S.of(context).modal_today_prayer_already);
}
}
This content originally appeared on DEV Community and was authored by sidcode

sidcode | Sciencx (2024-07-20T09:49:36+00:00) Don’t use ‘BuildContext’s across async gaps.. Retrieved from https://www.scien.cx/2024/07/20/dont-use-buildcontexts-across-async-gaps/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.