addAPICall method

Future<void> addAPICall({
  1. required String apiType,
  2. required String endPoint,
  3. required String apiName,
  4. required String featureName,
  5. required String responseModelName,
  6. required String shimmerChoice,
  7. required String requestModelName,
  8. required String apiMethodName,
})

Implementation

Future<void> addAPICall({
  required String apiType,
  required String endPoint,
  required String apiName,
  required String featureName,
  required String responseModelName,
  required String shimmerChoice,
  required String requestModelName,
  required String apiMethodName,
}) async {
  /// update api_constants.dart file to add end point
  await AddAPICallUtil().apiConstantFileUpdate(
    apiType: apiType,
    apiName: apiName,
    endPoint: endPoint,
  );

  /// update api_constants.dart file to add end point
  await AddAPICallUtil().mockApiConstantFileUpdate(
    apiName: apiName,
  );

  /// update data_source.dart and data_source_impl to add imports statement and function signature
  await AddAPICallUtil().createDataSourceAndDataSourceImpl(
    featureName: featureName,
    requestModelName: requestModelName,
    apiName: apiName,
    apiMethodName: apiMethodName,
  );

  /// update repo.dart and repo_impl.dart to add imports statement and function signature
  await AddAPICallUtil().createRepoAndRepoImpl(
    featureName: featureName,
    requestModelName: requestModelName,
    responseModelName: responseModelName,
    apiName: apiName,
    apiMethodName: apiMethodName,
  );

  /// update a usecase
  await AddAPICallUtil().createUsaCase(
    featureName: featureName,
    useCaseName: apiName,
    requestModelName: requestModelName,
    apiMethod: apiMethodName,
  );

  /// update bloc ,event and state to add imports statement and function signature
  await AddAPICallUtil().updateBlocEventAndStates(
    featureName: featureName,
    requestModelName: requestModelName,
    responseModelName: responseModelName,
    apiName: apiName,
    apiMethodName: apiMethodName,
    shimmerChoice: shimmerChoice,
  );
}