addAPICall method

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

Implementation

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

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

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

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

  /// update a usecase
  AddAPICallUtil()
      .createUsaCase(featureName, apiName, requestModelName, apiMethodName);

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