outsourced add cam main widgets and cleaned karte widget up
time
This commit is contained in:
61
lib/screens/addCam/widgets/sttyp.dart
Normal file
61
lib/screens/addCam/widgets/sttyp.dart
Normal 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!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user