yRunCompleter<T> function

Future<T> yRunCompleter<T>(
  1. dynamic action(
    1. Completer<T> completer
    )
)

异步转同步

Implementation

Future<T> yRunCompleter<T>(Function(Completer<T> completer) action) {
  final completer = Completer<T>();
  action(completer);
  return completer.future;
}