feat(App): update Finlytic Flutter app UI and blocs

This commit is contained in:
2026-08-09 21:01:46 +02:00
parent e7427b7464
commit a708d2977c
591 changed files with 1095105 additions and 0 deletions
@@ -0,0 +1,43 @@
import 'package:equatable/equatable.dart';
/// UserModel representing authenticated user session data.
class UserModel extends Equatable {
final String userId;
final String email;
final String fullName;
final String role;
final String? token;
const UserModel({
required this.userId,
required this.email,
required this.fullName,
required this.role,
this.token,
});
bool get isAdmin => role.toLowerCase() == 'admin';
factory UserModel.fromJson(Map<String, dynamic> json, {String? token}) {
return UserModel(
userId: json['userId']?.toString() ?? json['id']?.toString() ?? '',
email: json['email']?.toString() ?? '',
fullName: json['fullName']?.toString() ?? json['name']?.toString() ?? '',
role: json['role']?.toString() ?? 'User',
token: token ?? json['token']?.toString(),
);
}
Map<String, dynamic> toJson() {
return {
'userId': userId,
'email': email,
'fullName': fullName,
'role': role,
'token': token,
};
}
@override
List<Object?> get props => [userId, email, fullName, role, token];
}