generateMethod static method

String generateMethod(
  1. FunctionDef f
)

Implementation

static String generateMethod(FunctionDef f) {
  final methodName = f.name;
  final requestType = ModelGenerator.getRequestModelType(f);
  final responseType = ModelGenerator.getResponseModelType(f);
  final returnType = responseType == 'dynamic' ? 'dynamic' : '$responseType?';
  return '  Future<DataState<$returnType>> $methodName($requestType params);';
}