waitAtLeast<T> function
Implementation
Future<T> waitAtLeast<T>(Future<T> future,
{Duration delay = const Duration(milliseconds: 1000)}) async {
final startedAt = DateTime.now();
final result = await future;
final timeTaken = DateTime.now().millisecond - startedAt.millisecond;
if (timeTaken > delay.inMilliseconds) {
return result;
}
await Future.delayed(delay);
return result;
}