mirror of
https://gitlab.com/foxixus/neomovies_mobile.git
synced 2025-10-28 01:18:50 +05:00
Initial commit
This commit is contained in:
17
lib/data/models/auth_response.dart
Normal file
17
lib/data/models/auth_response.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import 'package:neomovies_mobile/data/models/user.dart';
|
||||
|
||||
class AuthResponse {
|
||||
final String token;
|
||||
final User user;
|
||||
final bool verified;
|
||||
|
||||
AuthResponse({required this.token, required this.user, required this.verified});
|
||||
|
||||
factory AuthResponse.fromJson(Map<String, dynamic> json) {
|
||||
return AuthResponse(
|
||||
token: json['token'] as String,
|
||||
user: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
verified: (json['verified'] as bool?) ?? (json['user']?['verified'] as bool? ?? true),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user