From 5c9d5f0a29748992784f541d173d66d080d9a353 Mon Sep 17 00:00:00 2001 From: Sanket6652 Date: Fri, 19 Jan 2024 14:18:26 +0530 Subject: [PATCH 1/2] fix: Podcast episode preview content is same for all episodes #1175 --- .../podcast_widgets/podcast_tilte_widget.dart | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart b/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart index d132382c9..f89ee5cdb 100644 --- a/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart +++ b/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart @@ -15,6 +15,7 @@ import 'package:freecodecamp/service/dio_service.dart'; import 'package:freecodecamp/service/podcast/download_service.dart'; import 'package:freecodecamp/service/podcast/podcasts_service.dart'; import 'package:freecodecamp/ui/views/podcast/episode/episode_view.dart'; +import 'package:html/parser.dart'; import 'package:intl/intl.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -268,8 +269,7 @@ class PodcastTileState extends State { podcast: widget.podcast, ), settings: RouteSettings( - name: - '/podcasts-episode/${widget.episode.title}'), + name: '/podcasts-episode/${widget.episode.title}'), ), ); } @@ -434,23 +434,36 @@ class PodcastTileState extends State { } Padding descriptionWidget() { + final textContent = parse(widget.episode.description!).body?.text ?? ''; return Padding( padding: const EdgeInsets.all(8.0), - child: Html( - data: widget.podcast.description!, - onLinkTap: (url, attributes, element) { - launchUrl(Uri.parse(url!)); - }, - style: { - '#': Style( - fontSize: FontSize(16), - color: Colors.white.withOpacity(0.87), - margin: Margins.zero, - maxLines: 3, - fontFamily: 'Lato', - ) - }, + child: Text( + textContent, + maxLines: 3, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 16, + color: Colors.white.withOpacity(0.87), + fontFamily: 'Lato', + ), ), + // child: Html( + // data: widget.episode.description!, + // onLinkTap: (url, attributes, element) { + // launchUrl(Uri.parse(url!)); + // }, + // style: { + // '#': Style( + // fontSize: FontSize(16), + // color: Colors.white.withOpacity(0.87), + // margin: Margins.zero, + + // fontFamily: 'Lato', + // ), + + // }, + // maxLines:3, + // ), ); } } From 017bc779bbfa4f3178cb94177391de28ea61dfe0 Mon Sep 17 00:00:00 2001 From: Sanket6652 Date: Sat, 20 Jan 2024 23:50:15 +0530 Subject: [PATCH 2/2] fix: podcast episode preview content --- .../podcast_widgets/podcast_tilte_widget.dart | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart b/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart index f89ee5cdb..46d61d47d 100644 --- a/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart +++ b/mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart @@ -5,7 +5,6 @@ import 'package:dio/dio.dart'; import 'package:fk_user_agent/fk_user_agent.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; -import 'package:flutter_html/flutter_html.dart'; import 'package:freecodecamp/app/app.locator.dart'; import 'package:freecodecamp/extensions/i18n_extension.dart'; import 'package:freecodecamp/models/podcasts/episodes_model.dart'; @@ -19,7 +18,6 @@ import 'package:html/parser.dart'; import 'package:intl/intl.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:url_launcher/url_launcher.dart'; // ignore: must_be_immutable class PodcastTile extends StatefulWidget { @@ -447,23 +445,6 @@ class PodcastTileState extends State { fontFamily: 'Lato', ), ), - // child: Html( - // data: widget.episode.description!, - // onLinkTap: (url, attributes, element) { - // launchUrl(Uri.parse(url!)); - // }, - // style: { - // '#': Style( - // fontSize: FontSize(16), - // color: Colors.white.withOpacity(0.87), - // margin: Margins.zero, - - // fontFamily: 'Lato', - // ), - - // }, - // maxLines:3, - // ), ); } }