Implement husband-wife connection dialogue and theme support for learn articles
This commit is contained in:
@@ -21,12 +21,12 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.warmCream,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.warmCream,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back, color: AppColors.navyBlue),
|
||||
icon: Icon(Icons.arrow_back, color: Theme.of(context).iconTheme.color),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
title: Text(
|
||||
@@ -34,7 +34,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: AppColors.warmGray,
|
||||
color: Theme.of(context).textTheme.bodySmall?.color,
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
@@ -50,7 +50,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.navyBlue,
|
||||
color: Theme.of(context).textTheme.headlineMedium?.color,
|
||||
height: 1.2,
|
||||
),
|
||||
),
|
||||
@@ -59,7 +59,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
article.subtitle,
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 15,
|
||||
color: AppColors.warmGray,
|
||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
@@ -69,21 +69,21 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
height: 3,
|
||||
width: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.gold,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Sections
|
||||
...article.sections.map((section) => _buildSection(section)),
|
||||
...article.sections.map((section) => _buildSection(context, section)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSection(LearnSection section) {
|
||||
Widget _buildSection(BuildContext context, LearnSection section) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 24),
|
||||
child: Column(
|
||||
@@ -95,18 +95,18 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.navyBlue,
|
||||
color: Theme.of(context).textTheme.titleLarge?.color,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
_buildRichText(section.content),
|
||||
_buildRichText(context, section.content),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRichText(String content) {
|
||||
Widget _buildRichText(BuildContext context, String content) {
|
||||
// Handle basic markdown-like formatting
|
||||
final List<InlineSpan> spans = [];
|
||||
final RegExp boldPattern = RegExp(r'\*\*(.*?)\*\*');
|
||||
@@ -119,7 +119,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
text: content.substring(currentIndex, match.start),
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 15,
|
||||
color: AppColors.charcoal,
|
||||
color: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
height: 1.7,
|
||||
),
|
||||
));
|
||||
@@ -130,7 +130,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColors.navyBlue,
|
||||
color: Theme.of(context).textTheme.titleMedium?.color,
|
||||
height: 1.7,
|
||||
),
|
||||
));
|
||||
@@ -143,7 +143,7 @@ class LearnArticleScreen extends StatelessWidget {
|
||||
text: content.substring(currentIndex),
|
||||
style: GoogleFonts.outfit(
|
||||
fontSize: 15,
|
||||
color: AppColors.charcoal,
|
||||
color: Theme.of(context).textTheme.bodyLarge?.color,
|
||||
height: 1.7,
|
||||
),
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user