Implemented sign up and otp screens

This commit is contained in:
Abdullah Alassaf
2024-05-29 01:51:36 +03:00
parent e37d324bb6
commit 28576f2cd5
21 changed files with 395 additions and 143 deletions
+11 -2
View File
@@ -24,12 +24,21 @@ class AuthenticationAPI {
return response;
}
static Future<Token> signUp({required SignUpModel model}) async {
static Future<bool> signUp({required SignUpModel model}) async {
final response = await HTTPService().post(
path: ApiEndpoints.signUp,
body: model.toJson(),
showServerMessage: false,
expectedResponseModel: (json) => Token.fromJson(json['data']));
expectedResponseModel: (json) => json['statusCode'] == 201);
return response;
}
static Future<Map<String, dynamic>> sendOtp({required Map<String, dynamic> body}) async {
final response = await HTTPService().post(
path: ApiEndpoints.sendOtp,
body: body,
showServerMessage: false,
expectedResponseModel: (json) => json['data']);
return response;
}
}