feat(alarmas): agregar fade-in configurable en activacion
This commit is contained in:
@@ -191,6 +191,10 @@ class _TarjetaAlarma extends StatelessWidget {
|
||||
icon: Icons.volume_up_rounded,
|
||||
label: '${(alarma.volumen * 100).round()}%',
|
||||
),
|
||||
_InfoChip(
|
||||
icon: Icons.trending_up_rounded,
|
||||
label: 'Fade-in ${alarma.fadeInSegundos}s',
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
@@ -321,6 +325,7 @@ class _EditorAlarmaSheetState extends State<_EditorAlarmaSheet> {
|
||||
late Set<int> _diasSemana;
|
||||
late int _snooze;
|
||||
late double _volumen;
|
||||
late int _fadeInSegundos;
|
||||
late bool _sonarEnVacaciones;
|
||||
late SonidoInternoAlarma _sonidoInterno;
|
||||
Emisora? _emisora;
|
||||
@@ -343,6 +348,7 @@ class _EditorAlarmaSheetState extends State<_EditorAlarmaSheet> {
|
||||
_diasSemana = {...alarma?.diasSemana ?? const <int>[]};
|
||||
_snooze = alarma?.snoozeMinutos ?? 5;
|
||||
_volumen = alarma?.volumen ?? 0.85;
|
||||
_fadeInSegundos = ((alarma?.fadeInSegundos ?? 0).clamp(0, 60)) as int;
|
||||
_sonarEnVacaciones = alarma?.sonarEnVacaciones ?? true;
|
||||
_sonidoInterno = alarma?.sonidoInterno ?? SonidoInternoAlarma.amanecer;
|
||||
_emisora = alarma?.emisora ?? context.read<EstadoRadio>().emisoraPreferida;
|
||||
@@ -502,6 +508,26 @@ class _EditorAlarmaSheetState extends State<_EditorAlarmaSheet> {
|
||||
label: '${(_volumen * 100).round()}%',
|
||||
onChanged: (value) => setState(() => _volumen = value),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: const Text('Fade-in de alarma'),
|
||||
subtitle: Text(
|
||||
_fadeInSegundos == 0
|
||||
? '0 s (sin transición)'
|
||||
: '$_fadeInSegundos s (de 5% al volumen elegido)',
|
||||
),
|
||||
),
|
||||
Slider(
|
||||
value: _fadeInSegundos.toDouble(),
|
||||
min: 0,
|
||||
max: 60,
|
||||
divisions: 60,
|
||||
label: '${_fadeInSegundos}s',
|
||||
onChanged:
|
||||
(value) =>
|
||||
setState(() => _fadeInSegundos = value.round()),
|
||||
),
|
||||
DropdownButtonFormField<SonidoInternoAlarma>(
|
||||
initialValue: _sonidoInterno,
|
||||
decoration: const InputDecoration(
|
||||
@@ -655,6 +681,7 @@ class _EditorAlarmaSheetState extends State<_EditorAlarmaSheet> {
|
||||
sonarEnVacaciones: _sonarEnVacaciones,
|
||||
snoozeMinutos: _snooze,
|
||||
volumen: _volumen,
|
||||
fadeInSegundos: _fadeInSegundos.clamp(0, 60),
|
||||
sonidoInterno: _sonidoInterno,
|
||||
activa: true,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user