Resolve all lints and deprecation warnings
This commit is contained in:
@@ -17,70 +17,85 @@ class RelationshipSettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
body: userProfile == null
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: ListView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: [
|
||||
const Text(
|
||||
'Select your current relationship status to customize your experience.',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
// Sample Data Button
|
||||
Center(
|
||||
child: TextButton.icon(
|
||||
onPressed: () {
|
||||
final user = ref.read(userProfileProvider);
|
||||
if (user != null) {
|
||||
final samplePlan = TeachingPlan.create(
|
||||
topic: 'Walking in Love',
|
||||
scriptureReference: 'Ephesians 5:1-2',
|
||||
notes: 'As Christ loved us and gave himself up for us, a fragrant offering and sacrifice to God. Let our marriage reflect this sacrificial love.',
|
||||
date: DateTime.now(),
|
||||
);
|
||||
|
||||
final List<TeachingPlan> updatedPlans = [...(user.teachingPlans ?? []), samplePlan];
|
||||
ref.read(userProfileProvider.notifier).updateProfile(
|
||||
user.copyWith(teachingPlans: updatedPlans)
|
||||
);
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Sample Teaching Plan Loaded! Check Devotional page.')),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.science_outlined),
|
||||
label: const Text('Load Sample Teaching Plan (Demo)'),
|
||||
: RadioGroup<RelationshipStatus>(
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
onChanged: (RelationshipStatus? newValue) {
|
||||
if (newValue != null) {
|
||||
ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateRelationshipStatus(newValue);
|
||||
}
|
||||
},
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
children: [
|
||||
const Text(
|
||||
'Select your current relationship status to customize your experience.',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Single',
|
||||
subtitle: 'Tracking for potential future',
|
||||
value: RelationshipStatus.single,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.person_outline,
|
||||
),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Engaged',
|
||||
subtitle: 'Preparing for marriage',
|
||||
value: RelationshipStatus.engaged,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.favorite_border,
|
||||
),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Married',
|
||||
subtitle: 'Tracking together with husband',
|
||||
value: RelationshipStatus.married,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.favorite,
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
// Sample Data Button
|
||||
Center(
|
||||
child: TextButton.icon(
|
||||
onPressed: () {
|
||||
final user = ref.read(userProfileProvider);
|
||||
if (user != null) {
|
||||
final samplePlan = TeachingPlan.create(
|
||||
topic: 'Walking in Love',
|
||||
scriptureReference: 'Ephesians 5:1-2',
|
||||
notes:
|
||||
'As Christ loved us and gave himself up for us, a fragrant offering and sacrifice to God. Let our marriage reflect this sacrificial love.',
|
||||
date: DateTime.now(),
|
||||
);
|
||||
|
||||
final List<TeachingPlan> updatedPlans = [
|
||||
...(user.teachingPlans ?? []),
|
||||
samplePlan
|
||||
];
|
||||
ref.read(userProfileProvider.notifier).updateProfile(
|
||||
user.copyWith(teachingPlans: updatedPlans));
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text(
|
||||
'Sample Teaching Plan Loaded! Check Devotional page.')),
|
||||
);
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.science_outlined),
|
||||
label: const Text('Load Sample Teaching Plan (Demo)'),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Single',
|
||||
subtitle: 'Tracking for potential future',
|
||||
value: RelationshipStatus.single,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.person_outline,
|
||||
),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Engaged',
|
||||
subtitle: 'Preparing for marriage',
|
||||
value: RelationshipStatus.engaged,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.favorite_border,
|
||||
),
|
||||
_buildOption(
|
||||
context,
|
||||
ref,
|
||||
title: 'Married',
|
||||
subtitle: 'Tracking together with husband',
|
||||
value: RelationshipStatus.married,
|
||||
groupValue: userProfile.relationshipStatus,
|
||||
icon: Icons.favorite,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -98,7 +113,7 @@ class RelationshipSettingsScreen extends ConsumerWidget {
|
||||
|
||||
return Card(
|
||||
elevation: isSelected ? 2 : 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: isSelected
|
||||
? BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)
|
||||
@@ -106,17 +121,10 @@ class RelationshipSettingsScreen extends ConsumerWidget {
|
||||
),
|
||||
child: RadioListTile<RelationshipStatus>(
|
||||
value: value,
|
||||
groupValue: groupValue,
|
||||
onChanged: (RelationshipStatus? newValue) {
|
||||
if (newValue != null) {
|
||||
ref
|
||||
.read(userProfileProvider.notifier)
|
||||
.updateRelationshipStatus(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),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user