Kontaktok listázási hibájának javítása, csv export
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
/// tábla dönti el. Az uuid szerveroldali (gen_random_uuid()).
|
||||
class Contact {
|
||||
final String? id; // uuid — új rekordnál null, a szerver adja
|
||||
final String
|
||||
projectId; // az AKTUÁLIS projekt uuid-ja (terepi_seged_projects.id)
|
||||
final String name;
|
||||
final String address;
|
||||
final String phone;
|
||||
@@ -16,6 +18,7 @@ class Contact {
|
||||
|
||||
const Contact({
|
||||
this.id,
|
||||
required this.projectId,
|
||||
required this.name,
|
||||
this.address = '',
|
||||
this.phone = '',
|
||||
@@ -34,6 +37,7 @@ class Contact {
|
||||
}) =>
|
||||
Contact(
|
||||
id: id,
|
||||
projectId: projectId,
|
||||
name: name ?? this.name,
|
||||
address: address ?? this.address,
|
||||
phone: phone ?? this.phone,
|
||||
@@ -48,6 +52,7 @@ class Contact {
|
||||
/// sosem a kliens állítja.
|
||||
Map<String, dynamic> toWriteMap() => {
|
||||
if (id != null) 'id': id,
|
||||
'project_id': projectId,
|
||||
'name': name.trim(),
|
||||
'address': address.trim(),
|
||||
'phone': phone.trim(),
|
||||
@@ -57,6 +62,7 @@ class Contact {
|
||||
|
||||
factory Contact.fromMap(Map<String, dynamic> m) => Contact(
|
||||
id: m['id'] as String?,
|
||||
projectId: m['project_id'] as String,
|
||||
name: (m['name'] as String?) ?? '',
|
||||
address: (m['address'] as String?) ?? '',
|
||||
phone: (m['phone'] as String?) ?? '',
|
||||
|
||||
Reference in New Issue
Block a user