outsourced add cam main widgets and cleaned karte widget up
time
This commit is contained in:
61
lib/screens/addCam/widgets/foto_film.dart
Normal file
61
lib/screens/addCam/widgets/foto_film.dart
Normal file
@@ -0,0 +1,61 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
|
||||
class FotoFilm extends StatefulWidget {
|
||||
final Function(String) onFotoFilmChanged;
|
||||
final String initialFotoFilm;
|
||||
|
||||
const FotoFilm(
|
||||
{super.key,
|
||||
required this.onFotoFilmChanged,
|
||||
this.initialFotoFilm = 'foto'});
|
||||
|
||||
@override
|
||||
State<FotoFilm> createState() => _FotoFilmState();
|
||||
}
|
||||
|
||||
class _FotoFilmState extends State<FotoFilm> {
|
||||
String? _selectedFotoFilm;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_selectedFotoFilm = widget.initialFotoFilm;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
ListTile(
|
||||
visualDensity: const VisualDensity(vertical: -4),
|
||||
title: Text(AppLocalizations.of(context)!.foto),
|
||||
leading: Radio<String>(
|
||||
value: 'Foto',
|
||||
groupValue: _selectedFotoFilm,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedFotoFilm = value;
|
||||
widget.onFotoFilmChanged(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
visualDensity: const VisualDensity(vertical: -4),
|
||||
title: Text(AppLocalizations.of(context)!.film),
|
||||
leading: Radio<String>(
|
||||
value: 'Film',
|
||||
groupValue: _selectedFotoFilm,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_selectedFotoFilm = value;
|
||||
widget.onFotoFilmChanged(value!);
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user