signUp method

Future<bool> signUp({
  1. required String name,
  2. required String email,
  3. required String password,
})

Implementation

Future<bool> signUp(
    {required String name,
    required String email,
    required String password}) async {
  final json = {"name": name, "email": email, "password": password};
  final res = await post("/users/sign-up", json: json, authenticated: false);
  final decodedResponse = jsonDecode(res.body);

  accessToken = AccessToken(decodedResponse["accessToken"] as String);
  refreshToken = decodedResponse["refreshToken"] as String?;
  return true;
}