Kapcsolat hozzáadása koordinátával a terepbejárás térképen.
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:
@@ -33,6 +33,10 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
late final TextEditingController _note;
|
||||
|
||||
bool _saving = false;
|
||||
late double? _lat;
|
||||
late double? _lon;
|
||||
late double? _eovY;
|
||||
late double? _eovX;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -43,6 +47,10 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
_phone = TextEditingController(text: _original?.phone ?? '');
|
||||
_email = TextEditingController(text: _original?.email ?? '');
|
||||
_note = TextEditingController(text: _original?.note ?? '');
|
||||
_lat = _original?.lat;
|
||||
_lon = _original?.lon;
|
||||
_eovY = _original?.eovY;
|
||||
_eovX = _original?.eovX;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -69,7 +77,13 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
phone: _phone.text,
|
||||
email: _email.text,
|
||||
note: _note.text,
|
||||
lat: _lat,
|
||||
lon: _lon,
|
||||
eovY: _eovY,
|
||||
eovX: _eovX,
|
||||
clearLocation: _lat == null,
|
||||
);
|
||||
|
||||
final queued = await ContactService.to.save(contact);
|
||||
Get.back(result: queued); // a lista frissítéshez visszakapja
|
||||
if (Get.isRegistered<ContactsController>()) {
|
||||
@@ -182,6 +196,27 @@ class _ContactEditViewState extends State<ContactEditView> {
|
||||
alignLabelWithHint: true,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (_lat != null && _lon != null)
|
||||
Card(
|
||||
color: Colors.indigo.withOpacity(0.06),
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.location_on, color: Colors.indigo),
|
||||
title: Text(
|
||||
'${_lat!.toStringAsFixed(6)}, ${_lon!.toStringAsFixed(6)}'),
|
||||
subtitle: const Text('Helyszín rögzítve'),
|
||||
trailing: IconButton(
|
||||
icon: const Icon(Icons.close),
|
||||
tooltip: 'Helyszín törlése',
|
||||
onPressed: () => setState(() {
|
||||
_lat = null;
|
||||
_lon = null;
|
||||
_eovY = null;
|
||||
_eovX = null;
|
||||
}),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
FilledButton.icon(
|
||||
onPressed: _saving ? null : _save,
|
||||
|
||||
Reference in New Issue
Block a user