Refine: Add real-time countdown timer and display settings to Pad Tracker

This commit is contained in:
2026-01-02 18:17:23 -06:00
parent 8772b56f36
commit f54222d26a
4 changed files with 107 additions and 10 deletions

View File

@@ -26,6 +26,8 @@ class _SuppliesSettingsScreenState extends ConsumerState<SuppliesSettingsScreen>
int _padInventoryCount = 0;
int _lowInventoryThreshold = 5;
bool _isAutoInventoryEnabled = true;
bool _showPadTimerMinutes = true;
bool _showPadTimerSeconds = false;
final TextEditingController _brandController = TextEditingController();
@override
@@ -40,6 +42,8 @@ class _SuppliesSettingsScreenState extends ConsumerState<SuppliesSettingsScreen>
_lowInventoryThreshold = user.lowInventoryThreshold;
_isAutoInventoryEnabled = user.isAutoInventoryEnabled;
_brandController.text = user.padBrand ?? '';
_showPadTimerMinutes = user.showPadTimerMinutes;
_showPadTimerSeconds = user.showPadTimerSeconds;
}
}
@@ -57,6 +61,8 @@ class _SuppliesSettingsScreenState extends ConsumerState<SuppliesSettingsScreen>
typicalFlowIntensity: _typicalFlow,
isAutoInventoryEnabled: _isAutoInventoryEnabled,
padBrand: _brandController.text.trim().isEmpty ? null : _brandController.text.trim(),
showPadTimerMinutes: _showPadTimerMinutes,
showPadTimerSeconds: _showPadTimerSeconds,
);
await ref.read(userProfileProvider.notifier).updateProfile(updatedProfile);
@@ -173,6 +179,40 @@ class _SuppliesSettingsScreenState extends ConsumerState<SuppliesSettingsScreen>
onChanged: (val) => setState(() => _isAutoInventoryEnabled = val),
activeColor: AppColors.menstrualPhase,
),
const Divider(height: 32),
Text(
'Timer Display Settings',
style: GoogleFonts.outfit(
fontSize: 16,
fontWeight: FontWeight.w500,
color: AppColors.warmGray,
),
),
const SizedBox(height: 8),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(
'Show Minutes',
style: GoogleFonts.outfit(fontWeight: FontWeight.w500, color: AppColors.charcoal),
),
value: _showPadTimerMinutes,
onChanged: (val) => setState(() => _showPadTimerMinutes = val),
activeColor: AppColors.menstrualPhase,
),
SwitchListTile(
contentPadding: EdgeInsets.zero,
title: Text(
'Show Seconds',
style: GoogleFonts.outfit(fontWeight: FontWeight.w500, color: AppColors.charcoal),
),
value: _showPadTimerSeconds,
onChanged: (val) => setState(() => _showPadTimerSeconds = val),
activeColor: AppColors.menstrualPhase,
),
],
],
),