mirror of
https://github.com/friebetill/TubeCards.git
synced 2025-08-14 01:35:57 +08:00
12 lines
274 B
Dart
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);
|
|
}
|