8bbc9dbff2
- Flutter + PocketBase dental lab management system - Clinic & lab dashboards, job tracking, patient management - Product catalog, finance tracking, multi-language support - AI assistant integration, realtime notifications - Windows installer (Inno Setup) included - Developed by kovakyazilim.com
32 lines
807 B
Dart
32 lines
807 B
Dart
class UserProfile {
|
|
const UserProfile({
|
|
required this.id,
|
|
required this.email,
|
|
this.firstName,
|
|
this.lastName,
|
|
this.preferredLanguage,
|
|
});
|
|
|
|
final String id;
|
|
final String email;
|
|
final String? firstName;
|
|
final String? lastName;
|
|
final String? preferredLanguage;
|
|
|
|
String get displayName =>
|
|
[firstName, lastName].where((s) => s != null && s.isNotEmpty).join(' ');
|
|
|
|
factory UserProfile.fromJson(Map<String, dynamic> j) => UserProfile(
|
|
id: j['id'] as String,
|
|
email: j['email'] as String,
|
|
firstName: _str(j['first_name']),
|
|
lastName: _str(j['last_name']),
|
|
preferredLanguage: _str(j['preferred_language']),
|
|
);
|
|
|
|
static String? _str(dynamic v) {
|
|
final s = v as String?;
|
|
return (s == null || s.isEmpty) ? null : s;
|
|
}
|
|
}
|