Resolve all lints and deprecation warnings

This commit is contained in:
2026-01-09 10:04:51 -06:00
parent 512577b092
commit a799e9cf59
56 changed files with 2819 additions and 3159 deletions

View File

@@ -18,47 +18,60 @@ class GoalSettingsScreen extends ConsumerWidget {
appBar: AppBar(
title: const Text('Cycle Goal'),
),
body: ListView(
padding: const EdgeInsets.all(16.0),
children: [
const Text(
'What is your current goal?',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
const Text(
'Select your primary goal to get personalized insights and predictions.',
style: TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(height: 24),
_buildGoalOption(
context,
ref,
title: 'Track Cycle Only',
subtitle: 'Monitor period and health without fertility focus',
value: FertilityGoal.justTracking,
groupValue: userProfile.fertilityGoal,
icon: Icons.calendar_today,
),
_buildGoalOption(
context,
ref,
title: 'Achieve Pregnancy',
subtitle: 'Identify fertile window and ovulation',
value: FertilityGoal.tryingToConceive,
groupValue: userProfile.fertilityGoal,
icon: Icons.child_friendly,
),
_buildGoalOption(
context,
ref,
title: 'Avoid Pregnancy',
subtitle: 'Track fertility for natural family planning',
value: FertilityGoal.tryingToAvoid,
groupValue: userProfile.fertilityGoal,
icon: Icons.security,
),
],
body: RadioGroup<FertilityGoal>(
groupValue: userProfile.fertilityGoal,
onChanged: (FertilityGoal? newValue) {
if (newValue != null) {
final currentProfile = ref.read(userProfileProvider);
if (currentProfile != null) {
ref.read(userProfileProvider.notifier).updateProfile(
currentProfile.copyWith(fertilityGoal: newValue),
);
}
}
},
child: ListView(
padding: const EdgeInsets.all(16.0),
children: [
const Text(
'What is your current goal?',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
const SizedBox(height: 8),
const Text(
'Select your primary goal to get personalized insights and predictions.',
style: TextStyle(fontSize: 14, color: Colors.grey),
),
const SizedBox(height: 24),
_buildGoalOption(
context,
ref,
title: 'Track Cycle Only',
subtitle: 'Monitor period and health without fertility focus',
value: FertilityGoal.justTracking,
groupValue: userProfile.fertilityGoal,
icon: Icons.calendar_today,
),
_buildGoalOption(
context,
ref,
title: 'Achieve Pregnancy',
subtitle: 'Identify fertile window and ovulation',
value: FertilityGoal.tryingToConceive,
groupValue: userProfile.fertilityGoal,
icon: Icons.child_friendly,
),
_buildGoalOption(
context,
ref,
title: 'Avoid Pregnancy',
subtitle: 'Track fertility for natural family planning',
value: FertilityGoal.tryingToAvoid,
groupValue: userProfile.fertilityGoal,
icon: Icons.security,
),
],
),
),
);
}
@@ -85,20 +98,10 @@ class GoalSettingsScreen extends ConsumerWidget {
),
child: RadioListTile<FertilityGoal>(
value: value,
groupValue: groupValue,
onChanged: (FertilityGoal? newValue) {
if (newValue != null) {
final currentProfile = ref.read(userProfileProvider);
if (currentProfile != null) {
ref.read(userProfileProvider.notifier).updateProfile(
currentProfile.copyWith(fertilityGoal: newValue),
);
}
}
},
title: Text(title, style: const TextStyle(fontWeight: FontWeight.w600)),
subtitle: Text(subtitle),
secondary: Icon(icon, color: isSelected ? Theme.of(context).colorScheme.primary : null),
secondary: Icon(icon,
color: isSelected ? Theme.of(context).colorScheme.primary : null),
activeColor: Theme.of(context).colorScheme.primary,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
),