clean console problems
This commit is contained in:
@@ -5,29 +5,35 @@ import 'package:home/src/presentation/wallet_management_layout.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class WageScreen extends ConsumerWidget {
|
||||
class WageScreen extends ConsumerStatefulWidget {
|
||||
final Kid kid;
|
||||
|
||||
WageScreen({super.key, required this.kid});
|
||||
const WageScreen({super.key, required this.kid});
|
||||
|
||||
String frequence = "weekly";
|
||||
var conditions = {
|
||||
"weeklyLimits": false,
|
||||
"incidences": false,
|
||||
"holidays": false,
|
||||
@override
|
||||
ConsumerState<WageScreen> createState() => _WageScreenState();
|
||||
}
|
||||
|
||||
class _WageScreenState extends ConsumerState<WageScreen> {
|
||||
String frequence = 'weekly';
|
||||
|
||||
final Map<String, bool> conditions = {
|
||||
'weeklyLimits': false,
|
||||
'incidences': false,
|
||||
'holidays': false,
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
|
||||
return WalletManagementLayout(
|
||||
kid: kid,
|
||||
kid: widget.kid,
|
||||
footer: Container(
|
||||
padding: EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
borderRadius: BorderRadius.only(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
@@ -36,14 +42,14 @@ class WageScreen extends ConsumerWidget {
|
||||
spacing: 10,
|
||||
children: [
|
||||
FilledButton(
|
||||
onPressed: () => {},
|
||||
onPressed: () {},
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.all(20),
|
||||
child: Center(child: Text("Activar paga automática")),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: const Center(child: Text('Activar paga automática')),
|
||||
),
|
||||
),
|
||||
TextButton(onPressed: () => {}, child: Text("Cancelar")),
|
||||
TextButton(onPressed: () {}, child: const Text('Cancelar')),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -51,108 +57,110 @@ class WageScreen extends ConsumerWidget {
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
"Paga automática",
|
||||
const Text(
|
||||
'Paga automática',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
||||
),
|
||||
TextField(
|
||||
decoration: InputDecoration(
|
||||
labelText: "Cantidad",
|
||||
hintText: "0€",
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Cantidad',
|
||||
hintText: '0€',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
|
||||
),
|
||||
Text("Saldo total disponible después: 30 €"),
|
||||
const Text('Saldo total disponible después: 30 €'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
"Frecuencia",
|
||||
const Text(
|
||||
'Frecuencia',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
||||
),
|
||||
Text("Cuándo se envía el dinero"),
|
||||
const Text('Cuándo se envía el dinero'),
|
||||
CheckboxListTile(
|
||||
title: Text('Semanal'),
|
||||
title: const Text('Semanal'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: frequence == "weekly",
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// frequence = "weekly";
|
||||
// });
|
||||
value: frequence == 'weekly',
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
frequence = 'weekly';
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: Text('Cada dos semanas'),
|
||||
title: const Text('Cada dos semanas'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: frequence == "biweekly",
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// frequence = "biweekly";
|
||||
// });
|
||||
value: frequence == 'biweekly',
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
frequence = 'biweekly';
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: Text('Mensual'),
|
||||
title: const Text('Mensual'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: frequence == "monthly",
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// frequence = "monthly";
|
||||
// });
|
||||
value: frequence == 'monthly',
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
frequence = 'monthly';
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
Container(
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: DropdownMenu(
|
||||
label: Text("Día de la semana"),
|
||||
initialSelection: "Domingo",
|
||||
dropdownMenuEntries: List<DropdownMenuEntry>.generate(7, (
|
||||
int index,
|
||||
) {
|
||||
final days = [
|
||||
"Lunes",
|
||||
"Martes",
|
||||
"Miércoles",
|
||||
"Jueves",
|
||||
"Viernes",
|
||||
"Sábado",
|
||||
"Domingo",
|
||||
child: DropdownMenu<String>(
|
||||
label: const Text('Día de la semana'),
|
||||
initialSelection: 'Domingo',
|
||||
dropdownMenuEntries: () {
|
||||
const days = [
|
||||
'Lunes',
|
||||
'Martes',
|
||||
'Miércoles',
|
||||
'Jueves',
|
||||
'Viernes',
|
||||
'Sábado',
|
||||
'Domingo',
|
||||
];
|
||||
return DropdownMenuEntry(
|
||||
value: days[index],
|
||||
label: days[index],
|
||||
return List<DropdownMenuEntry<String>>.generate(
|
||||
days.length,
|
||||
(index) => DropdownMenuEntry<String>(
|
||||
value: days[index],
|
||||
label: days[index],
|
||||
),
|
||||
);
|
||||
}),
|
||||
}(),
|
||||
),
|
||||
),
|
||||
DropdownMenu(
|
||||
label: Text("Hora del día"),
|
||||
DropdownMenu<int>(
|
||||
label: const Text('Hora del día'),
|
||||
initialSelection: 9,
|
||||
dropdownMenuEntries: List<DropdownMenuEntry>.generate(24, (
|
||||
int index,
|
||||
) {
|
||||
return DropdownMenuEntry(value: index, label: "$index:00");
|
||||
}),
|
||||
dropdownMenuEntries: List<DropdownMenuEntry<int>>.generate(
|
||||
24,
|
||||
(index) =>
|
||||
DropdownMenuEntry<int>(value: index, label: '$index:00'),
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
minLines: 3,
|
||||
@@ -160,62 +168,65 @@ class WageScreen extends ConsumerWidget {
|
||||
maxLength: 150,
|
||||
decoration: InputDecoration(
|
||||
labelText:
|
||||
"Escribir mensaje a ${kid.name} del motivo del ingreso",
|
||||
hintText: "Escribe tu mensaje",
|
||||
border: OutlineInputBorder(),
|
||||
'Escribir mensaje a ${widget.kid.name} del motivo del ingreso',
|
||||
hintText: 'Escribe tu mensaje',
|
||||
border: const OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
const Align(
|
||||
alignment: Alignment.topLeft,
|
||||
child: Text("Máximo 150 caracteres"),
|
||||
child: Text('Máximo 150 caracteres'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: theme.getColorFor(ThemeCode.backgroundPrimary),
|
||||
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
padding: EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
child: Column(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
"Condiciones",
|
||||
const Text(
|
||||
'Condiciones',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20),
|
||||
),
|
||||
Text("Este dato aparecerá en el reloj del peque"),
|
||||
const Text('Este dato aparecerá en el reloj del peque'),
|
||||
CheckboxListTile(
|
||||
title: Text('Sólo si cumple límites semanales'),
|
||||
title: const Text('Sólo si cumple límites semanales'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: conditions["weeklyLimits"],
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// conditions["weeklyLimits"] = !conditions["weeklyLimits"]!;
|
||||
// });
|
||||
value: conditions['weeklyLimits'],
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
conditions['weeklyLimits'] =
|
||||
!(conditions['weeklyLimits'] ?? false);
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: Text('Sólo si no ha tenido incidencias'),
|
||||
title: const Text('Sólo si no ha tenido incidencias'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: conditions["incidences"],
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// conditions["incidences"] = !conditions["incidences"]!;
|
||||
// });
|
||||
value: conditions['incidences'],
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
conditions['incidences'] =
|
||||
!(conditions['incidences'] ?? false);
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
CheckboxListTile(
|
||||
title: Text('Pausar durante vacaciones'),
|
||||
title: const Text('Pausar durante vacaciones'),
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
value: conditions["holidays"],
|
||||
onChanged: (value) {
|
||||
// setState(() {
|
||||
// conditions["holidays"] = !conditions["holidays"]!;
|
||||
// });
|
||||
value: conditions['holidays'],
|
||||
onChanged: (_) {
|
||||
setState(() {
|
||||
conditions['holidays'] = !(conditions['holidays'] ?? false);
|
||||
});
|
||||
},
|
||||
activeColor: theme.getColorFor(ThemeCode.buttonPrimary),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user