generateRequestModel method
Implementation
Future<String> generateRequestModel({
required String featureName,
required String apiName,
required String apiMethodType,
}) async {
String requestModelName = kWhitespaces;
if (apiMethodType == kGet) {
Utility.stdoutWrite(text: kQueryParametersOrNot);
} else {
Utility.stdoutWrite(text: kRequestBodyOrNot);
}
String requestModelChoice = stdin.readLineSync()!.toLowerCase();
if (requestModelChoice == kYes) {
requestModelName = "${apiName}$kRequestModel";
Utility.stdoutWrite(text: kRequestJsonFilePath);
String requestModelJsonFilePath = stdin.readLineSync()!;
Utility.createFolder(path: '$kLib$kFeatures$featureName$kModelPath');
CreateModel().generateDartModel(
modelName: requestModelName,
featureName: featureName,
jsonFilePath: requestModelJsonFilePath,
);
}
return requestModelName;
}