withRedrawSuspended<T> method
Run action while redraw is disabled, then restore and refresh.
Implementation
Future<T> withRedrawSuspended<T>(
Future<T> Function() action, {
bool refreshAfter = true,
}) async {
await setRedraw(false);
try {
return await action();
} finally {
await setRedraw(true);
if (refreshAfter) {
await refresh();
}
}
}