elCaribe app - customization and branding
This commit is contained in:
34
news-app/lib/data/models/AuthModel.dart
Normal file
34
news-app/lib/data/models/AuthModel.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
import 'package:news/data/models/authorModel.dart';
|
||||
import 'package:news/utils/strings.dart';
|
||||
|
||||
class AuthModel {
|
||||
String? id;
|
||||
String? name;
|
||||
String? email;
|
||||
String? mobile;
|
||||
String? profile;
|
||||
String? type;
|
||||
String? status;
|
||||
String? isFirstLogin; // 0 - new user, 1 - existing user
|
||||
String? role;
|
||||
String? jwtToken;
|
||||
int? isAuthor;
|
||||
Author? authorDetails;
|
||||
|
||||
AuthModel({this.id, this.name, this.email, this.mobile, this.profile, this.type, this.status, this.isFirstLogin, this.role, this.jwtToken, this.authorDetails, this.isAuthor = 0});
|
||||
|
||||
AuthModel.fromJson(Map<String, dynamic> json) {
|
||||
id = json[ID].toString();
|
||||
name = json[NAME] ?? "";
|
||||
email = json[EMAIL] ?? "";
|
||||
mobile = json[MOBILE] ?? "";
|
||||
profile = json[PROFILE] ?? "";
|
||||
type = json[TYPE] ?? "";
|
||||
status = json[STATUS].toString();
|
||||
isFirstLogin = (json[IS_LOGIN] != null) ? json[IS_LOGIN].toString() : "";
|
||||
role = json[ROLE].toString();
|
||||
jwtToken = json[TOKEN] ?? "";
|
||||
isAuthor = json[IS_AUTHOR];
|
||||
authorDetails = (isAuthor == 1 && json[AUTHOR] != null) ? Author.fromJson(json[AUTHOR]) : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user