Dart 飞奔未来的接线员

Dart 飞奔未来的接线员,dart,Dart,什么是操作员在之后\u cachedValueFuture Future fetch(Future Function()回调)异步{ 如果(_cachedStreamSplitter!=null){ throw StateError('以前通过'fetchStream'用于缓存]); } if(_cachedValueFuture==null){ _cachedValueFuture=callback(); 等待未来; _startStaleTimer(); } 返回_cachedValueFu

什么是
操作员在
之后\u cachedValueFuture

Future fetch(Future Function()回调)异步{
如果(_cachedStreamSplitter!=null){
throw StateError('以前通过'fetchStream'用于缓存]);
}
if(_cachedValueFuture==null){
_cachedValueFuture=callback();
等待未来;
_startStaleTimer();
}
返回_cachedValueFuture!;
}
在下一版本中,它将成为Dart的一部分,并具有空安全功能

\u cachedValueFuture
变量的类型为
Future?
,表示Future或null。
null
,则code>运算符将抛出,因此
的类型将是缓存值future
Future
,它是函数的必需返回类型。

它是Dart的一部分,在下一版本中具有空安全功能

\u cachedValueFuture
变量的类型为
Future?
,表示Future或null。
null
,则code>运算符将抛出,因此
的类型将是缓存值future
Future
,这是函数所需的返回类型