Implement husband-wife connection dialogue and theme support for learn articles
This commit is contained in:
@@ -31,6 +31,9 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
int _averageCycleLength = 28;
|
||||
DateTime? _lastPeriodStart;
|
||||
bool _isIrregularCycle = false;
|
||||
int _minCycleLength = 25;
|
||||
int _maxCycleLength = 35;
|
||||
bool _isPadTrackingEnabled = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -121,8 +124,11 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
? _fertilityGoal
|
||||
: null,
|
||||
averageCycleLength: _averageCycleLength,
|
||||
minCycleLength: _minCycleLength,
|
||||
maxCycleLength: _maxCycleLength,
|
||||
lastPeriodStartDate: _lastPeriodStart,
|
||||
isIrregularCycle: _isIrregularCycle,
|
||||
isPadTrackingEnabled: _isPadTrackingEnabled,
|
||||
hasCompletedOnboarding: true,
|
||||
createdAt: DateTime.now(),
|
||||
updatedAt: DateTime.now(),
|
||||
@@ -704,6 +710,53 @@ class _OnboardingScreenState extends ConsumerState<OnboardingScreen> {
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
),
|
||||
|
||||
if (_isIrregularCycle) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text('Cycle range (shortest to longest)',
|
||||
style: theme.textTheme.titleSmall?.copyWith(
|
||||
fontWeight: FontWeight.w500,
|
||||
color: theme.colorScheme.onSurface)),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RangeSlider(
|
||||
values: RangeValues(_minCycleLength.toDouble(), _maxCycleLength.toDouble()),
|
||||
min: 21,
|
||||
max: 45,
|
||||
divisions: 24,
|
||||
activeColor: AppColors.sageGreen,
|
||||
labels: RangeLabels('$_minCycleLength days', '$_maxCycleLength days'),
|
||||
onChanged: (values) {
|
||||
setState(() {
|
||||
_minCycleLength = values.start.round();
|
||||
_maxCycleLength = values.end.round();
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Center(
|
||||
child: Text('$_minCycleLength - $_maxCycleLength days',
|
||||
style: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.sageGreen)),
|
||||
),
|
||||
],
|
||||
|
||||
// Enable Supply Tracking Checkbox
|
||||
CheckboxListTile(
|
||||
title: Text('Enable supply tracking',
|
||||
style: theme.textTheme.bodyLarge
|
||||
?.copyWith(color: theme.colorScheme.onSurface)),
|
||||
value: _isPadTrackingEnabled,
|
||||
onChanged: (val) =>
|
||||
setState(() => _isPadTrackingEnabled = val ?? false),
|
||||
activeColor: AppColors.sageGreen,
|
||||
contentPadding: EdgeInsets.zero,
|
||||
controlAffinity: ListTileControlAffinity.leading,
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
Text('Last period start date',
|
||||
style: theme.textTheme.titleMedium?.copyWith(
|
||||
|
||||
Reference in New Issue
Block a user