buildModelFile static method

Future<void> buildModelFile({
  1. required RequestModel requestModel,
  2. required dynamic response,
})

create model file using requestModel and response

Implementation

static Future<void> buildModelFile({
  required RequestModel requestModel,
  required dynamic response,
}) async {
  await FolderAndFileService.createFile(
    FolderPaths.instance
        .modelFile(requestModel.modelName, requestModel.featureName),
    convertMapToClassModel(
      name: requestModel.modelName,
      response: response is Map ? response : response[0],
    ),
  );

  print("✅ Create ${requestModel.modelName} file successfully ...\n\n");
}