ApplicationUser.fromJson constructor
ApplicationUser.fromJson(
- Map<String, dynamic> json
)
Implementation
factory ApplicationUser.fromJson(Map<String, dynamic> json) {
return ApplicationUser(
applicationUserId: json['ApplicationUserId'],
fullName: json['FullName'],
name: json['Name'],
email: json['Email'],
password: json['Password'],
activatedCode: json['ActivatedCode'] == 1 || json['ActivatedCode'] == true,
isActive: json['IsActive'] == 1 || json['IsActive'] == true,
createdAt:
json['CreatedAt'] != null ? DateTime.tryParse(json['CreatedAt']) : null,
updatedAt:
json['UpdatedAt'] != null ? DateTime.tryParse(json['UpdatedAt']) : null,
permissions: json['Permissions'],
accessLevel: json['AccessLevel'],
notes: json['Notes'],
groupAccessRight: json['group_access_right'],
token: json['token'],
accessRights: json['access_rights'],
roleAccessRights: json['role_access_rights'],
settings: json['Settings'] == 1 || json['Settings'] == true,
generalLedger:
json['General_Ledger'] == 1 || json['General_Ledger'] == true,
accountReceivable:
json['Account_receivable'] == 1 || json['Account_receivable'] == true,
bank: json['Bank'] == 1 || json['Bank'] == true,
department: json['Department'] == 1 || json['Department'] == true,
accountPayable:
json['Account_Payable'] == 1 || json['Account_Payable'] == true,
stock: json['Stock'] == 1 || json['Stock'] == true,
saleOrder: json['SaleOrder'] == 1 || json['SaleOrder'] == true,
purchaseOrder:
json['PurchaseOrder'] == 1 || json['PurchaseOrder'] == true,
pos: json['POS'] == 1 || json['POS'] == true,
hrd: json['HRD'] == 1 || json['HRD'] == true,
warehousing: json['Warehousing'] == 1 || json['Warehousing'] == true,
service: json['Service'] == 1 || json['Service'] == true,
logistic: json['Logistic'] == 1 || json['Logistic'] == true,
task: json['task'] == 1 || json['task'] == true,
asset: json['asset'] == 1 || json['asset'] == true,
);
}