refresh token

This commit is contained in:
efrilm
2025-09-20 18:05:15 +07:00
parent a58d1040af
commit 59a8d7f661
3 changed files with 43 additions and 75 deletions
@@ -2,9 +2,11 @@ import 'dart:convert';
class AuthResponseModel {
final String? token;
final String? refreshToken;
final User? user;
AuthResponseModel({
this.refreshToken,
this.token,
this.user,
});
@@ -17,11 +19,13 @@ class AuthResponseModel {
factory AuthResponseModel.fromMap(Map<String, dynamic> json) =>
AuthResponseModel(
token: json["token"],
refreshToken: json["refresh_token"],
user: json["user"] == null ? null : User.fromMap(json["user"]),
);
Map<String, dynamic> toMap() => {
"token": token,
"refresh_token": refreshToken,
"user": user?.toMap(),
};
}