delete property

  1. @override
Future<Response<Object>> delete
override

Implementation

@override
Future<Response> get delete async {
  final response = Response();
  if (user != null) {
    try {
      return user!.delete().then((value) {
        return response.withStatus(
          Status.ok,
          message: "Account delete successful!",
        );
      });
    } on FirebaseAuthException catch (_) {
      return response.withException(_.message, status: Status.failure);
    }
  } else {
    return response.withException(
      "User isn't valid!",
      status: Status.invalid,
    );
  }
}