Skip to content

Commit

Permalink
Fix overflow bug with article preview text
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirtex committed Oct 13, 2023
1 parent 4fdeca0 commit 79df996
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
2 changes: 1 addition & 1 deletion lib/explore/widgets/articles_preview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ArticlesPreview extends StatelessWidget {
child: Text('Latest News'),
),
SizedBox(
height: 340,
height: 350,
child: articles.isNotEmpty
? ListView.builder(
scrollDirection: Axis.horizontal,
Expand Down
50 changes: 28 additions & 22 deletions lib/news/widgets/article_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,38 @@ class ArticleCard extends StatelessWidget {
dateFormat: DateFormat.yMMMd(),
)!,
),
slideOutPadding: EdgeInsets.zero,
slideOut: ClipRRect(
borderRadius: const BorderRadius.vertical(
top: Radius.circular(kBorderRadius),
),
child: SizedBox(
height: 150,
child: MissionImage(
fit: BoxFit.cover,
imageUrl: article.imageUrl,
),
),
),
padding: EdgeInsets.zero,
onTap: () => launchUrlString(article.url),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
AutoSizeText(
article.title,
style: Theme.of(context).textTheme.titleMedium,
SizedBox(
height: 150,
child: MissionImage(
fit: BoxFit.cover,
imageUrl: article.imageUrl,
),
),
const SizedBox(height: kListSpacing),
Text(
article.summary,
overflow: TextOverflow.ellipsis,
maxLines: 3,
Expanded(
child: Padding(
padding: const EdgeInsets.all(10),
child: Column(
children: [
AutoSizeText(
article.title,
style: Theme.of(context).textTheme.titleMedium,
maxLines: 3,
),
const SizedBox(height: kListSpacing),
Flexible(
child: AutoSizeText(
'${article.summary.split(' ').take(25).join(' ')}...',
),
),
],
),
),
),
],
),
Expand Down

0 comments on commit 79df996

Please sign in to comment.