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 createState() => _STTypState(); } class _STTypState extends State { 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( 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( value: 'systematisch', groupValue: _selectedSTTyp, onChanged: (value) { setState(() { _selectedSTTyp = value; widget.onSTTypChanged(value!); }); }, ), ), ], ); } }