mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Improve local favorites performance.
This commit is contained in:
@@ -107,4 +107,15 @@ abstract class MapOrNull{
|
||||
static Map<K, V>? from<K, V>(Map<dynamic, dynamic>? i){
|
||||
return i == null ? null : Map<K, V>.from(i);
|
||||
}
|
||||
}
|
||||
|
||||
extension FutureExt<T> on Future<T>{
|
||||
/// Wrap the future to make sure it will return at least the duration.
|
||||
Future<T> minTime(Duration duration) async {
|
||||
var res = await Future.wait([
|
||||
this,
|
||||
Future.delayed(duration),
|
||||
]);
|
||||
return res[0];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user