functionFutureOr static method

dynamic functionFutureOr(
  1. dynamic fn()
)

Implementation

static dynamic functionFutureOr(Function() fn) {
  final ret = fn();

  return ret is Future ? Promise.futureToPromise(ret) : ret;
}