FunctionCallable.init constructor

FunctionCallable.init(
  1. Function callable, {
  2. bool catchError = false,
})

Implementation

FunctionCallable.init(Function callable, {this.catchError = false}) {
  final c = reflect(callable);
  if (c is ClosureMirror) {
    _callable = c;
    _callable?.function.parameters.forEach((ParameterMirror p) {
      final name = MirrorSystem.getName(p.simpleName);
      final type = MirrorSystem.getName(p.type.simpleName);
      arguments
          .add(new Argument(name, p.simpleName, type, p.type.simpleName));
    });
  }
}