diff --git a/mobile-app/lib/ui/views/learn/block/templates/dialogue/dialogue_view.dart b/mobile-app/lib/ui/views/learn/block/templates/dialogue/dialogue_view.dart index d32f6e214..8b8ddf4ad 100644 --- a/mobile-app/lib/ui/views/learn/block/templates/dialogue/dialogue_view.dart +++ b/mobile-app/lib/ui/views/learn/block/templates/dialogue/dialogue_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_scroll_shadow/flutter_scroll_shadow.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; @@ -50,9 +51,13 @@ class BlockDialogueView extends StatelessWidget { children: [ ...parser.parse( '
${block.description.join(' ')}
', - fontColor: FccColors.gray05, - removeParagraphMargin: true, isSelectable: false, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + 'p': Style(margin: Margins.zero), + }, ), _buildToggleButton(context), _buildChallengeList(context, structure, dialogueHeaders), diff --git a/mobile-app/lib/ui/views/learn/block/templates/grid/grid_view.dart b/mobile-app/lib/ui/views/learn/block/templates/grid/grid_view.dart index d209ebcad..3115d10a3 100644 --- a/mobile-app/lib/ui/views/learn/block/templates/grid/grid_view.dart +++ b/mobile-app/lib/ui/views/learn/block/templates/grid/grid_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_scroll_shadow/flutter_scroll_shadow.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; @@ -83,9 +84,13 @@ class BlockGridView extends StatelessWidget { ), ...parser.parse( '${block.description.join(' ')}
', - fontColor: FccColors.gray05, - removeParagraphMargin: true, isSelectable: false, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + 'p': Style(margin: Margins.zero), + }, ), Row( children: [ diff --git a/mobile-app/lib/ui/views/learn/block/templates/link/link_view.dart b/mobile-app/lib/ui/views/learn/block/templates/link/link_view.dart index 7462c7f0d..189dea8b0 100644 --- a/mobile-app/lib/ui/views/learn/block/templates/link/link_view.dart +++ b/mobile-app/lib/ui/views/learn/block/templates/link/link_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; import 'package:freecodecamp/ui/views/learn/block/block_template_viewmodel.dart'; @@ -55,9 +56,13 @@ class BlockLinkView extends StatelessWidget { ), ...parser.parse( '${block.description.join(' ')}
', - fontColor: FccColors.gray05, - removeParagraphMargin: true, isSelectable: false, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + 'p': Style(margin: Margins.zero), + }, ), Row( children: [ diff --git a/mobile-app/lib/ui/views/learn/block/templates/list/list_view.dart b/mobile-app/lib/ui/views/learn/block/templates/list/list_view.dart index 704671a06..cdb1febe9 100644 --- a/mobile-app/lib/ui/views/learn/block/templates/list/list_view.dart +++ b/mobile-app/lib/ui/views/learn/block/templates/list/list_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; import 'package:freecodecamp/ui/views/learn/block/block_template_viewmodel.dart'; @@ -77,9 +78,13 @@ class BlockListView extends StatelessWidget { ), ...parser.parse( '${block.description.join(' ')}
', - fontColor: FccColors.gray05, - removeParagraphMargin: true, isSelectable: false, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + 'p': Style(margin: Margins.zero), + }, ), Row( children: [ diff --git a/mobile-app/lib/ui/views/learn/challenge/challenge_view.dart b/mobile-app/lib/ui/views/learn/challenge/challenge_view.dart index bbd134c9d..1bbf17dc6 100644 --- a/mobile-app/lib/ui/views/learn/challenge/challenge_view.dart +++ b/mobile-app/lib/ui/views/learn/challenge/challenge_view.dart @@ -1,6 +1,7 @@ import 'dart:developer'; import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:freecodecamp/enums/panel_type.dart'; import 'package:freecodecamp/models/learn/challenge_model.dart'; @@ -497,8 +498,12 @@ class ChallengeView extends StatelessWidget { final widgets = parser.parse( test.instruction, isSelectable: true, - removeParagraphMargin: true, - fontColor: FccColors.gray00, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray00, + ), + 'p': Style(margin: Margins.zero), + }, ); return ExpansionTile( backgroundColor: FccColors.gray90, diff --git a/mobile-app/lib/ui/views/learn/challenge/templates/english/english_view.dart b/mobile-app/lib/ui/views/learn/challenge/templates/english/english_view.dart index a5abf6bbe..551e8dff5 100644 --- a/mobile-app/lib/ui/views/learn/challenge/templates/english/english_view.dart +++ b/mobile-app/lib/ui/views/learn/challenge/templates/english/english_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/models/learn/challenge_model.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; @@ -45,11 +46,17 @@ class EnglishView extends StatelessWidget { children: [ ...parser.parse( challenge.instructions, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': + Style(color: FccColors.gray05), + }, ), ...parser.parse( challenge.description, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': + Style(color: FccColors.gray05), + }, ), ], ), diff --git a/mobile-app/lib/ui/views/learn/challenge/templates/quiz/quiz_view.dart b/mobile-app/lib/ui/views/learn/challenge/templates/quiz/quiz_view.dart index bc4a77776..f7f87c839 100644 --- a/mobile-app/lib/ui/views/learn/challenge/templates/quiz/quiz_view.dart +++ b/mobile-app/lib/ui/views/learn/challenge/templates/quiz/quiz_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/extensions/i18n_extension.dart'; import 'package:freecodecamp/models/learn/challenge_model.dart'; import 'package:freecodecamp/models/learn/curriculum_model.dart'; @@ -85,11 +86,17 @@ class QuizView extends StatelessWidget { children: [ ...parser.parse( challenge.instructions, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': + Style(color: FccColors.gray05), + }, ), ...parser.parse( challenge.description, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': + Style(color: FccColors.gray05), + }, ), ], ), diff --git a/mobile-app/lib/ui/views/learn/challenge/templates/review/review_viewmodel.dart b/mobile-app/lib/ui/views/learn/challenge/templates/review/review_viewmodel.dart index 8b13e3e7b..d92e90466 100644 --- a/mobile-app/lib/ui/views/learn/challenge/templates/review/review_viewmodel.dart +++ b/mobile-app/lib/ui/views/learn/challenge/templates/review/review_viewmodel.dart @@ -1,4 +1,5 @@ import 'package:flutter/widgets.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/app/app.locator.dart'; import 'package:freecodecamp/models/learn/challenge_model.dart'; import 'package:freecodecamp/service/learn/learn_service.dart'; @@ -49,12 +50,20 @@ class ReviewViewmodel extends BaseViewModel { setParsedInstructions = parser.parse( challenge.instructions, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + }, ); setParsedDescription = parser.parse( challenge.description, - fontColor: FccColors.gray05, + customStyles: { + '*:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6)': Style( + color: FccColors.gray05, + ), + }, ); } } diff --git a/mobile-app/lib/ui/views/learn/widgets/assignment_widget.dart b/mobile-app/lib/ui/views/learn/widgets/assignment_widget.dart index c5b39c19b..f87a70f8a 100644 --- a/mobile-app/lib/ui/views/learn/widgets/assignment_widget.dart +++ b/mobile-app/lib/ui/views/learn/widgets/assignment_widget.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; +import 'package:freecodecamp/ui/theme/fcc_theme.dart'; import 'package:freecodecamp/ui/views/news/html_handler/html_handler.dart'; class Assignment extends StatelessWidget { @@ -53,7 +55,11 @@ class Assignment extends StatelessWidget { children: parser.parse( label, isSelectable: false, - fontColor: value ? const Color(0xDEFFFFFF) : null, + customStyles: value + ? { + '*': Style(color: FccColors.gray00), + } + : {}, ), ), ), diff --git a/mobile-app/lib/ui/views/learn/widgets/quiz_widget.dart b/mobile-app/lib/ui/views/learn/widgets/quiz_widget.dart index 2ddcb6ac9..64285e337 100644 --- a/mobile-app/lib/ui/views/learn/widgets/quiz_widget.dart +++ b/mobile-app/lib/ui/views/learn/widgets/quiz_widget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/models/learn/challenge_model.dart'; import 'package:freecodecamp/ui/theme/fcc_theme.dart'; import 'package:freecodecamp/ui/views/learn/widgets/challenge_card.dart'; @@ -81,7 +82,9 @@ class _QuizWidgetState extends State