Finish KeyToken operations
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// Unfortunately Future.value(x) in FutureBuilder always results in one frame were snapshot.connectionState is waiting
|
||||
// This way we can set the ImmediateFuture.value directly and circumvent that.
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
class ImmediateFuture<T> {
|
||||
final Future<T> future;
|
||||
final T? value;
|
||||
@@ -20,6 +22,10 @@ class ImmediateFuture<T> {
|
||||
: future = Future.value(v),
|
||||
value = v;
|
||||
|
||||
ImmediateFuture.ofPending()
|
||||
: future = Completer<T>().future,
|
||||
value = null;
|
||||
|
||||
T? get() {
|
||||
return value ?? _futureValue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user