feat(App): update Finlytic Flutter app UI and blocs
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
class AdminUserModel extends Equatable {
|
||||
final String id;
|
||||
final String email;
|
||||
final String fullName;
|
||||
final String role;
|
||||
final bool isActive;
|
||||
|
||||
const AdminUserModel({
|
||||
required this.id,
|
||||
required this.email,
|
||||
required this.fullName,
|
||||
required this.role,
|
||||
required this.isActive,
|
||||
});
|
||||
|
||||
factory AdminUserModel.fromJson(Map<String, dynamic> json) {
|
||||
return AdminUserModel(
|
||||
id: json['id']?.toString() ?? '',
|
||||
email: json['email']?.toString() ?? '',
|
||||
fullName: json['fullName']?.toString() ?? json['name']?.toString() ?? '',
|
||||
role: json['role']?.toString() ?? 'User',
|
||||
isActive: json['isActive'] == true || json['IsActive'] == true,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'email': email,
|
||||
'fullName': fullName,
|
||||
'role': role,
|
||||
'isActive': isActive,
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
List<Object?> get props => [id, email, fullName, role, isActive];
|
||||
}
|
||||
Reference in New Issue
Block a user