added minimum duration of loading animation

This commit is contained in:
Elias Müller 2024-05-12 00:31:23 +02:00
parent e57a1a915e
commit 2056be23cd

View File

@ -12,7 +12,13 @@ abstract class DataLoader<TResult> {
}
Future<TResult> run() async {
var response = await fetch();
var fetcher = fetch();
await Future.wait([
fetcher,
Future.delayed(const Duration(milliseconds: 500)) // TODO tune or remove
]);
var response = await fetcher;
try {
return assemble(DataLoaderResult(
json: jsonDecode(response.data!),