rejectApplication method Null safety

Future<Response?> rejectApplication(
  1. {required String? applicationId,
  2. String? reviewDescription,
  3. GeneralCallback<Response>? callback}
)

Implementation

Future<Response<dynamic>?> rejectApplication({
  required String? applicationId,
  String? reviewDescription,
  GeneralCallback<Response<dynamic>>? callback,
}) async {
  try {
    final Response<dynamic> response = await dio.put(
      '/application/$applicationId/reject',
      data: <String, String>{
        'description': reviewDescription ?? '',
      },
    );
    if (callback != null) {
      callback.onSuccess(response);
    }
    return response;
  } on DioError catch (dioError) {
    if (callback == null) {
      rethrow;
    } else {
      handleCrudError(dioError, callback);
    }
  }
  return null;
}