luc sitzung

This commit is contained in:
nico
2024-05-08 21:56:09 +02:00
parent 77f14257d3
commit 3d08e7d968
12 changed files with 221 additions and 231 deletions

View File

@@ -147,6 +147,7 @@ class _VarTextFieldState extends State<VarTextField> {
class Karte extends StatefulWidget {
final TextEditingController beiOrtC;
final TextEditingController ortInfoC;
final Position currentPosition;
final Function(Position) onPositionChange;
@@ -154,7 +155,7 @@ class Karte extends StatefulWidget {
{super.key,
required this.currentPosition,
required this.onPositionChange,
required this.beiOrtC});
required this.beiOrtC, required this.ortInfoC});
@override
KarteState createState() => KarteState();
@@ -196,10 +197,12 @@ class KarteState extends State<Karte> {
List<Placemark> placemarks = await placemarkFromCoordinates(
selectedPosition!.latitude,
selectedPosition!.longitude);
print(placemarks);
if (selectedPosition != null) {
setState(() {
widget.beiOrtC.text = placemarks.first.locality!;
widget.ortInfoC.text = placemarks.first.street!;
updatedPosition = Position(
longitude: selectedPosition!.longitude,
@@ -307,7 +310,7 @@ class _DatumState extends State<Datum> {
children: [
Row(children: [
SizedBox(
width: 125,
width: 140,
child: ElevatedButton(
onPressed: () async {
final date = await pickDate();
@@ -468,10 +471,12 @@ class _STTypState extends State<STTyp> {
class Platzung extends StatefulWidget {
final Function(String) onPlatzungChanged;
final String? initialPlatzung;
const Platzung(
{super.key,
required this.onPlatzungChanged,
required this.onPlatzungChanged, this.initialPlatzung,
});
@override
@@ -481,6 +486,14 @@ class Platzung extends StatefulWidget {
class _PlatzungState extends State<Platzung> {
String? _selectedPlatzung;
@override
void initState() {
super.initState();
if (widget.initialPlatzung != "") {
_selectedPlatzung = widget.initialPlatzung;
}
}
@override
Widget build(BuildContext context) {
@@ -709,67 +722,6 @@ class _MEZState extends State<MEZ> {
}
}
// Bearsafe
class Bearsafe extends StatefulWidget {
final Function(String) onBearsafeChanged;
final String initialBearsafe;
const Bearsafe(
{super.key,
required this.onBearsafeChanged,
this.initialBearsafe = 'Nein'});
@override
State<Bearsafe> createState() => _BearsafeState();
}
class _BearsafeState extends State<Bearsafe> {
String? _selectedBearsafe;
@override
void initState() {
super.initState();
_selectedBearsafe = widget.initialBearsafe;
}
@override
Widget build(BuildContext context) {
return Column(
children: [
ListTile(
visualDensity: const VisualDensity(vertical: -4),
title: Text(AppLocalizations.of(context)!.nein),
leading: Radio<String>(
value: 'Nein',
groupValue: _selectedBearsafe,
onChanged: (value) {
setState(() {
_selectedBearsafe = value;
widget.onBearsafeChanged(value!);
});
},
),
),
ListTile(
visualDensity: const VisualDensity(vertical: -4),
title: Text(AppLocalizations.of(context)!.ja),
leading: Radio<String>(
value: 'Ja',
groupValue: _selectedBearsafe,
onChanged: (value) {
setState(() {
_selectedBearsafe = value;
widget.onBearsafeChanged(value!);
});
},
),
),
],
);
}
}
// KontDat
class KontDat extends StatefulWidget {
@@ -790,7 +742,7 @@ class _KontDatState extends State<KontDat> {
children: [
Row(children: [
SizedBox(
width: 125,
width: 140,
child: ElevatedButton(
onPressed: () async {
final date = await pickDate();
@@ -847,7 +799,7 @@ class _AbbauDatState extends State<AbbauDat> {
children: [
Row(children: [
SizedBox(
width: 125,
width: 140,
child: ElevatedButton(
onPressed: () async {
final date = await pickDate();