26 lines
671 B
Dart
26 lines
671 B
Dart
class Contact {
|
|
final String firstName;
|
|
final String lastName;
|
|
final String phone;
|
|
final String email;
|
|
final String role; // "predsednik", "članica" …; empty when the club data has none
|
|
|
|
const Contact({
|
|
required this.firstName,
|
|
required this.lastName,
|
|
required this.phone,
|
|
required this.email,
|
|
this.role = '',
|
|
});
|
|
|
|
String get fullName => '$firstName $lastName';
|
|
|
|
factory Contact.fromJson(Map<String, dynamic> json) => Contact(
|
|
firstName: json['firstName'] ?? '',
|
|
lastName: json['lastName'] ?? '',
|
|
phone: json['phone'] ?? '',
|
|
email: json['email'] ?? '',
|
|
role: json['role'] ?? '',
|
|
);
|
|
}
|