Future<T> runWithProgress<T>(Future<T> Function() f) async { try { state = true; return await f(); } finally { state = false; } }