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

@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:christian_period_tracker/models/scripture.dart';
class HusbandLearnScreen extends StatelessWidget {
const HusbandLearnScreen({super.key});
@@ -45,7 +44,8 @@ class HusbandLearnScreen extends StatelessWidget {
const SizedBox(height: 16),
Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
@@ -54,21 +54,24 @@ class HusbandLearnScreen extends StatelessWidget {
_buildTipCard(
context,
title: 'Understanding Female Cycles',
content: 'Learn about the different phases of your wife\'s menstrual cycle and how they affect her health.',
content:
'Learn about the different phases of your wife\'s menstrual cycle and how they affect her health.',
icon: Icons.calendar_month,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Supportive Role',
content: 'Be supportive during different phases, understanding when she may need more emotional support or rest.',
content:
'Be supportive during different phases, understanding when she may need more emotional support or rest.',
icon: Icons.support_agent,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Nutritional Support',
content: 'Understand how nutrition affects reproductive health and discuss dietary choices together.',
content:
'Understand how nutrition affects reproductive health and discuss dietary choices together.',
icon: Icons.food_bank,
),
],
@@ -90,7 +93,8 @@ class HusbandLearnScreen extends StatelessWidget {
const SizedBox(height: 16),
Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
@@ -99,21 +103,24 @@ class HusbandLearnScreen extends StatelessWidget {
_buildTipCard(
context,
title: 'Safe Sexual Practices',
content: 'Use protection consistently to prevent sexually transmitted infections and maintain mutual health.',
content:
'Use protection consistently to prevent sexually transmitted infections and maintain mutual health.',
icon: Icons.security,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Regular Testing',
content: 'Schedule regular STI screenings together with your partner for early detection and treatment.',
content:
'Schedule regular STI screenings together with your partner for early detection and treatment.',
icon: Icons.medical_information,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Open Communication',
content: 'Discuss health concerns openly to ensure both partners understand each other\'s needs and maintain trust.',
content:
'Discuss health concerns openly to ensure both partners understand each other\'s needs and maintain trust.',
icon: Icons.chat,
),
],
@@ -135,7 +142,8 @@ class HusbandLearnScreen extends StatelessWidget {
const SizedBox(height: 16),
Card(
elevation: 2,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
@@ -144,14 +152,16 @@ class HusbandLearnScreen extends StatelessWidget {
_buildTipCard(
context,
title: 'Educate Yourself',
content: 'Take the initiative to learn about reproductive health and partner needs.',
content:
'Take the initiative to learn about reproductive health and partner needs.',
icon: Icons.school,
),
const SizedBox(height: 16),
_buildTipCard(
context,
title: 'Active Listening',
content: 'Listen attentively when your wife discusses her health concerns or feelings.',
content:
'Listen attentively when your wife discusses her health concerns or feelings.',
icon: Icons.mic_none,
),
],
@@ -162,7 +172,10 @@ class HusbandLearnScreen extends StatelessWidget {
);
}
Widget _buildTipCard(BuildContext context, {required String title, required String content, required IconData icon}) {
Widget _buildTipCard(BuildContext context,
{required String title,
required String content,
required IconData icon}) {
return Card(
elevation: 1,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
@@ -174,10 +187,14 @@ class HusbandLearnScreen extends StatelessWidget {
width: 40,
height: 40,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer.withOpacity(0.2),
color: Theme.of(context)
.colorScheme
.primaryContainer
.withValues(alpha: 0.2),
shape: BoxShape.circle,
),
child: Icon(icon, size: 24, color: Theme.of(context).colorScheme.primary),
child: Icon(icon,
size: 24, color: Theme.of(context).colorScheme.primary),
),
const SizedBox(width: 16),
Expanded(
@@ -186,7 +203,10 @@ class HusbandLearnScreen extends StatelessWidget {
children: [
Text(
title,
style: Theme.of(context).textTheme.titleMedium?.copyWith(fontWeight: FontWeight.bold),
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(fontWeight: FontWeight.bold),
),
const SizedBox(height: 4),
Text(
@@ -201,4 +221,4 @@ class HusbandLearnScreen extends StatelessWidget {
),
);
}
}
}

View File

@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import '../../theme/app_theme.dart';
import '../husband/learn_article_screen.dart';
import '../husband/husband_learn_articles_screen.dart';
class WifeLearnScreen extends StatelessWidget {
const WifeLearnScreen({super.key});
@@ -23,7 +23,7 @@ class WifeLearnScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildSection(context, 'Understanding My Cycle', [
_buildSection(context, 'Understanding My Cycle', const [
_LearnItem(
icon: Icons.loop,
title: 'The 4 Phases',
@@ -34,11 +34,12 @@ class WifeLearnScreen extends StatelessWidget {
icon: Icons.psychology_outlined,
title: 'Mood & Hormones',
subtitle: 'Why I feel different each week',
articleId: 'wife_mood_changes', // Reusing similar concept, maybe new article
articleId:
'wife_mood_changes', // Reusing similar concept, maybe new article
),
]),
const SizedBox(height: 24),
_buildSection(context, 'Disease Prevention', [
_buildSection(context, 'Disease Prevention', const [
_LearnItem(
icon: Icons.health_and_safety_outlined,
title: 'Preventing Infections',
@@ -53,7 +54,7 @@ class WifeLearnScreen extends StatelessWidget {
),
]),
const SizedBox(height: 24),
_buildSection(context, 'Partnership', [
_buildSection(context, 'Partnership', const [
_LearnItem(
icon: Icons.favorite_border,
title: 'Communication',
@@ -73,7 +74,8 @@ class WifeLearnScreen extends StatelessWidget {
);
}
Widget _buildSection(BuildContext context, String title, List<_LearnItem> items) {
Widget _buildSection(
BuildContext context, String title, List<_LearnItem> items) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -92,7 +94,10 @@ class WifeLearnScreen extends StatelessWidget {
color: Theme.of(context).cardTheme.color,
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: Theme.of(context).colorScheme.outline.withOpacity(0.05)),
color: Theme.of(context)
.colorScheme
.outline
.withValues(alpha: 0.05)),
),
child: Column(
children: items
@@ -101,7 +106,10 @@ class WifeLearnScreen extends StatelessWidget {
width: 40,
height: 40,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primaryContainer.withOpacity(0.2),
color: Theme.of(context)
.colorScheme
.primaryContainer
.withValues(alpha: 0.2),
borderRadius: BorderRadius.circular(10),
),
child: Icon(
@@ -133,7 +141,9 @@ class WifeLearnScreen extends StatelessWidget {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => LearnArticleScreen(articleId: item.articleId),
builder: (context) =>
CombinedLearnArticleDetailScreen(
articleId: item.articleId),
),
);
},
@@ -158,4 +168,4 @@ class _LearnItem {
required this.subtitle,
required this.articleId,
});
}
}