getRepoImplStatementWithoutRequestModel method

List<String> getRepoImplStatementWithoutRequestModel(
  1. {required String pascalCaseApiName}
)

Implementation

List<String> getRepoImplStatementWithoutRequestModel({
  required String pascalCaseApiName,
}) =>
    [
      "  $kOverride",
      "  $kFutureFailureSuccess $kCall$pascalCaseApiName() =>",
      "      baseApiMethod(() => $kCall${pascalCaseApiName}ApiCall());",
      "",
      "  $kFutureFailureSuccess $kCall${pascalCaseApiName}ApiCall() async {",
      "    ApiResponse response = await dataSource.call$pascalCaseApiName();",
      "",
      "    if (!response.status!) {",
      "      return Left(",
      "        ServerFailure(",
      "          errorMessage: response.message!,",
      "          statusCode: response.statusCode ?? 0,",
      "        ),",
      "      );",
      "    } else {"
    ];