Browse Source

Merge pull request #313 from Leptopoda/fix/NewsFeedIcon_naming

neon: fix naming of NewsFeedIcon
pull/316/head
Kate 2 years ago committed by GitHub
parent
commit
c6455839aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      packages/neon/neon_news/lib/widgets/articles_view.dart
  2. 10
      packages/neon/neon_news/lib/widgets/feed_icon.dart

2
packages/neon/neon_news/lib/widgets/articles_view.dart

@ -137,7 +137,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
), ),
child: NewsFeedIcon( child: NewsFeedIcon(
feed: feed, feed: feed,
icon: 16, size: 16,
borderRadius: const BorderRadius.all(Radius.circular(2)), borderRadius: const BorderRadius.all(Radius.circular(2)),
), ),
), ),

10
packages/neon/neon_news/lib/widgets/feed_icon.dart

@ -3,29 +3,29 @@ part of '../neon_news.dart';
class NewsFeedIcon extends StatelessWidget { class NewsFeedIcon extends StatelessWidget {
const NewsFeedIcon({ const NewsFeedIcon({
required this.feed, required this.feed,
this.icon = 48, this.size = 48,
this.borderRadius, this.borderRadius,
super.key, super.key,
}); });
final NextcloudNewsFeed feed; final NextcloudNewsFeed feed;
final double icon; final double size;
final BorderRadius? borderRadius; final BorderRadius? borderRadius;
@override @override
Widget build(final BuildContext context) => NeonImageWrapper( Widget build(final BuildContext context) => NeonImageWrapper(
color: Colors.white, color: Colors.white,
size: Size.square(icon), size: Size.square(size),
borderRadius: borderRadius, borderRadius: borderRadius,
child: feed.faviconLink != null && feed.faviconLink != '' child: feed.faviconLink != null && feed.faviconLink != ''
? NeonCachedUrlImage( ? NeonCachedUrlImage(
url: feed.faviconLink!, url: feed.faviconLink!,
size: Size.square(icon), size: Size.square(size),
iconColor: Theme.of(context).colorScheme.primary, iconColor: Theme.of(context).colorScheme.primary,
) )
: Icon( : Icon(
Icons.rss_feed, Icons.rss_feed,
size: icon, size: size,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
); );

Loading…
Cancel
Save