safeSetState method
Implementation
void safeSetState(VoidCallback? closure) {
try {
if (mounted) {
setState(() {
closure?.call();
});
}
} catch (e) {
setStateAfterFrame(closure);
}
}
void safeSetState(VoidCallback? closure) {
try {
if (mounted) {
setState(() {
closure?.call();
});
}
} catch (e) {
setStateAfterFrame(closure);
}
}