update
This commit is contained in:
27
lib/models/auth/auth_model.dart
Normal file
27
lib/models/auth/auth_model.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import 'package:chat/models/user_info_model.dart';
|
||||
|
||||
class AuthModel {
|
||||
String tokenType;
|
||||
String accessToken;
|
||||
String userSig;
|
||||
String userID;
|
||||
UserInfoModel userInfo;
|
||||
|
||||
String get userToken => '$tokenType $accessToken';
|
||||
|
||||
AuthModel({
|
||||
required this.tokenType,
|
||||
required this.accessToken,
|
||||
required this.userID,
|
||||
required this.userSig,
|
||||
required this.userInfo,
|
||||
});
|
||||
|
||||
factory AuthModel.fromJson(Map<String, dynamic> json) => AuthModel(
|
||||
tokenType: json['token_type'],
|
||||
accessToken: json['access_token'],
|
||||
userID: json['user_id'],
|
||||
userSig: json['user_sig'],
|
||||
userInfo: UserInfoModel.fromJson(json['user_info']),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user