Files
fforte/lib/screens/addCam/widgets/sttyp.dart

62 lines
1.6 KiB
Dart

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!);
});
},
),
),
],
);
}
}