Kontaktok listázási hibájának javítása, csv export
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:terepi_seged/pages/contacts/presentation/controllers/contacts_controller.dart';
|
||||
import 'package:terepi_seged/services/project_service.dart';
|
||||
|
||||
import '../../../../models/contact.dart';
|
||||
import '../../../../services/contact_service.dart';
|
||||
@@ -57,7 +59,11 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
if (!(_formKey.currentState?.validate() ?? false)) return;
|
||||
setState(() => _saving = true);
|
||||
try {
|
||||
final contact = (_original ?? const Contact(name: '')).copyWith(
|
||||
final contact = (_original ??
|
||||
Contact(
|
||||
name: '',
|
||||
projectId: ProjectService.to.activeProject.value!.uuid))
|
||||
.copyWith(
|
||||
name: _name.text,
|
||||
address: _address.text,
|
||||
phone: _phone.text,
|
||||
@@ -66,6 +72,9 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
);
|
||||
final queued = await ContactService.to.save(contact);
|
||||
Get.back(result: queued); // a lista frissítéshez visszakapja
|
||||
if (Get.isRegistered<ContactsController>()) {
|
||||
Get.find<ContactsController>().load(silent: true);
|
||||
}
|
||||
Get.snackbar(queued ? 'Elmentve (offline)' : 'Mentve',
|
||||
queued ? '${contact.name} - feltöltés, amint van net' : contact.name,
|
||||
snackPosition: SnackPosition.BOTTOM);
|
||||
|
||||
Reference in New Issue
Block a user