Files
TubeCards/lib/utils/load_during.dart
friebetill 80f218097d Initial commit
Add Space version 2.0.1
2022-03-28 14:56:00 +02:00

12 lines
274 B
Dart

import 'package:flutter/foundation.dart';
/// Sets the load state to true while [function] is executed.
Future<void> loadDuring(
AsyncCallback function, {
required ValueChanged<bool> setLoading,
}) async {
setLoading(true);
await function();
setLoading(false);
}