added minimum duration of loading animation
This commit is contained in:
parent
e57a1a915e
commit
2056be23cd
@ -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!),
|
||||
|
Loading…
x
Reference in New Issue
Block a user