now doesnt leave the addcam when user canceles save as file option

This commit is contained in:
nico
2024-04-30 19:04:52 +02:00
parent 21db03d348
commit e0d74591c8
3 changed files with 118 additions and 33 deletions

View File

@@ -142,13 +142,15 @@ class _VarTextFieldState extends State<VarTextField> {
// ! completely new page
class Karte extends StatefulWidget {
final TextEditingController beiOrtC;
final Position currentPosition;
final Function(Position) onPositionChange;
const Karte(
{super.key,
required this.currentPosition,
required this.onPositionChange});
required this.onPositionChange,
required this.beiOrtC});
@override
KarteState createState() => KarteState();
@@ -194,11 +196,13 @@ class KarteState extends State<Karte> {
onPressed: () async {
List<Placemark> placemarks = await placemarkFromCoordinates(selectedPosition!.latitude, selectedPosition!.longitude);
print(placemarks);
if (selectedPosition != null) {
setState(() {
widget.beiOrtC.text = placemarks.first.locality!;
updatedPosition = Position(
longitude: selectedPosition!.longitude,
latitude: selectedPosition!.latitude,