exec method

Future exec(
  1. Function function,
  2. List? positionalArguments, [
  3. Map<Symbol, dynamic>? namedArguments
])

Implementation

Future exec(
  Function function,
  List<dynamic>? positionalArguments, [
  Map<Symbol, dynamic>? namedArguments,
]) {
  final applyFunction = () {
    return Function.apply(function, positionalArguments, namedArguments);
  };

  if (future == null) {
    future = Future(applyFunction);
    return future!;
  } else {
    future = future!.then((value) => applyFunction());
    return future!;
  }
}