createFunctionArgN method

Function createFunctionArgN(
  1. Function dartFunction
)

Implementation

Function createFunctionArgN(Function dartFunction) {
  final argCount = dartFunction.runtimeType.toString().contains("() =>")
      ? 0
      : dartFunction.runtimeType.toString().split("=>")[0].split(",").length;
  if (argCount == 0) {
    return createFunctionArg0(dartFunction);
  } else if (argCount == 1) {
    return createFunctionArg1(dartFunction);
  } else if (argCount == 2) {
    return createFunctionArg2(dartFunction);
  } else if (argCount == 3) {
    return createFunctionArg3(dartFunction);
  } else if (argCount == 4) {
    return createFunctionArg4(dartFunction);
  } else {
    return dartFunction;
  }
}