outsourced add cam main widgets and cleaned karte widget up

time
This commit is contained in:
Nico
2025-05-10 18:04:32 +02:00
parent 9879809857
commit 2a43ed5514
11 changed files with 635 additions and 641 deletions

View File

@@ -0,0 +1,61 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class STTyp extends StatefulWidget {
final Function(String) onSTTypChanged;
final String initialSTTyp;
const STTyp(
{super.key,
required this.onSTTypChanged,
this.initialSTTyp = 'opportunistisch'});
@override
State<STTyp> createState() => _STTypState();
}
class _STTypState extends State<STTyp> {
String? _selectedSTTyp;
@override
void initState() {
super.initState();
_selectedSTTyp = widget.initialSTTyp;
}
@override
Widget build(BuildContext context) {
return Column(
children: [
ListTile(
visualDensity: const VisualDensity(vertical: -4),
title: Text(AppLocalizations.of(context)!.opportunistisch),
leading: Radio<String>(
value: 'opportunistisch',
groupValue: _selectedSTTyp,
onChanged: (value) {
setState(() {
_selectedSTTyp = value;
widget.onSTTypChanged(value!);
});
},
),
),
ListTile(
visualDensity: const VisualDensity(vertical: -4),
title: Text(AppLocalizations.of(context)!.systematisch),
leading: Radio<String>(
value: 'systematisch',
groupValue: _selectedSTTyp,
onChanged: (value) {
setState(() {
_selectedSTTyp = value;
widget.onSTTypChanged(value!);
});
},
),
),
],
);
}
}