62 lines
1.5 KiB
Dart
62 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:fforte/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!);
|
|
});
|
|
},
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|