Skip to content

Commit

Permalink
fix: podcast episode preview content (#1177)
Browse files Browse the repository at this point in the history
* fix: Podcast episode preview content is same for all episodes #1175

* fix: podcast episode preview content
  • Loading branch information
Sanket6652 authored Jan 23, 2024
1 parent 66d5c19 commit b6b4356
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions mobile-app/lib/ui/widgets/podcast_widgets/podcast_tilte_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -15,10 +14,10 @@ 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';
import 'package:url_launcher/url_launcher.dart';

// ignore: must_be_immutable
class PodcastTile extends StatefulWidget {
Expand Down Expand Up @@ -268,8 +267,7 @@ class PodcastTileState extends State<PodcastTile> {
podcast: widget.podcast,
),
settings: RouteSettings(
name:
'/podcasts-episode/${widget.episode.title}'),
name: '/podcasts-episode/${widget.episode.title}'),
),
);
}
Expand Down Expand Up @@ -434,22 +432,18 @@ class PodcastTileState extends State<PodcastTile> {
}

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',
),
),
);
}
Expand Down

0 comments on commit b6b4356

Please sign in to comment.