(fix) felhős projekthez csak bejelentkezés után lehet csatlakozni, név megjelenítése a kapcsolatok mellett a terepbejárás nézetben.
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
This commit is contained in:
@@ -24,7 +24,8 @@ class ContactEditView extends StatefulWidget {
|
||||
|
||||
class _ContactEditViewState extends State<ContactEditView> {
|
||||
final _formKey = GlobalKey<FormState>();
|
||||
late final Contact? _original;
|
||||
Contact? _original;
|
||||
String? _originalLocalUuid;
|
||||
|
||||
late final TextEditingController _name;
|
||||
late final TextEditingController _address;
|
||||
@@ -41,7 +42,13 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_original = Get.arguments is Contact ? Get.arguments as Contact : null;
|
||||
final args = Get.arguments;
|
||||
if (args is ContactWithState) {
|
||||
_original = args.contact;
|
||||
_originalLocalUuid = args.isPending ? args.localUuid : null;
|
||||
} else if (args is Contact) {
|
||||
_original = args;
|
||||
}
|
||||
_name = TextEditingController(text: _original?.name ?? '');
|
||||
_address = TextEditingController(text: _original?.address ?? '');
|
||||
_phone = TextEditingController(text: _original?.phone ?? '');
|
||||
@@ -84,7 +91,8 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
clearLocation: _lat == null,
|
||||
);
|
||||
|
||||
final queued = await ContactService.to.save(contact);
|
||||
final queued = await ContactService.to
|
||||
.save(contact, existingLocalUuid: _originalLocalUuid);
|
||||
Get.back(result: queued); // a lista frissítéshez visszakapja
|
||||
if (Get.isRegistered<ContactsController>()) {
|
||||
Get.find<ContactsController>().load(silent: true);
|
||||
|
||||
@@ -127,7 +127,7 @@ class ContactsView extends StatelessWidget {
|
||||
item: rows[i],
|
||||
onEdit: () async {
|
||||
final saved = await Get.to(() => const ContactEditView(),
|
||||
arguments: rows[i].contact);
|
||||
arguments: rows[i]);
|
||||
if (saved != null) c.load();
|
||||
},
|
||||
onDelete: () => _confirmDelete(c, rows[i]),
|
||||
|
||||
Reference in New Issue
Block a user