Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(news_app): Apply size constraint in NewsFeedIcon #2472

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
child: NewsFeedIcon(
feed: feed,
size: smallIconSize,
borderRadius: const BorderRadius.all(Radius.circular(2)),
),
),
RelativeTime(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ class NewsFeedIcon extends StatelessWidget {
const NewsFeedIcon({
required this.feed,
this.size = largeIconSize,
this.borderRadius,
super.key,
});

final news.Feed feed;
final double size;
final BorderRadius? borderRadius;

@override
Widget build(BuildContext context) {
final faviconLink = feed.faviconLink;

return faviconLink != null && faviconLink.isNotEmpty
? NeonUriImage(
uri: Uri.parse(faviconLink),
size: Size.square(size),
account: NeonProvider.of<Account>(context),
)
: Icon(
Icons.rss_feed,
size: size,
color: Theme.of(context).colorScheme.primary,
);
return SizedBox.square(
dimension: size,
child: faviconLink != null && faviconLink.isNotEmpty
? NeonUriImage(
uri: Uri.parse(faviconLink),
size: Size.square(size),
account: NeonProvider.of<Account>(context),
)
: Icon(
Icons.rss_feed,
size: size,
color: Theme.of(context).colorScheme.primary,
),
);
}
}