Implement husband-wife connection dialogue and theme support for learn articles
This commit is contained in:
@@ -18,6 +18,7 @@ class _CycleSettingsScreenState extends ConsumerState<CycleSettingsScreen> {
|
||||
late TextEditingController _periodLengthController;
|
||||
DateTime? _lastPeriodStartDate;
|
||||
bool _isIrregularCycle = false;
|
||||
bool _isPadTrackingEnabled = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -29,6 +30,7 @@ class _CycleSettingsScreenState extends ConsumerState<CycleSettingsScreen> {
|
||||
text: userProfile?.averagePeriodLength.toString() ?? '5');
|
||||
_lastPeriodStartDate = userProfile?.lastPeriodStartDate;
|
||||
_isIrregularCycle = userProfile?.isIrregularCycle ?? false;
|
||||
_isPadTrackingEnabled = userProfile?.isPadTrackingEnabled ?? false;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -47,6 +49,7 @@ class _CycleSettingsScreenState extends ConsumerState<CycleSettingsScreen> {
|
||||
averagePeriodLength: int.tryParse(_periodLengthController.text) ?? userProfile.averagePeriodLength,
|
||||
lastPeriodStartDate: _lastPeriodStartDate,
|
||||
isIrregularCycle: _isIrregularCycle,
|
||||
isPadTrackingEnabled: _isPadTrackingEnabled,
|
||||
);
|
||||
ref.read(userProfileProvider.notifier).updateProfile(updatedProfile);
|
||||
Navigator.of(context).pop();
|
||||
@@ -130,6 +133,19 @@ class _CycleSettingsScreenState extends ConsumerState<CycleSettingsScreen> {
|
||||
});
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
SwitchListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
title: const Text('Enable Pad Tracking'),
|
||||
subtitle:
|
||||
const Text('Track supply usage and receive change reminders'),
|
||||
value: _isPadTrackingEnabled,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_isPadTrackingEnabled = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 40),
|
||||
ElevatedButton(
|
||||
onPressed: _saveSettings,
|
||||
|
||||
Reference in New Issue
Block a user