From b2b5b94a9cb0392bc6fbe424dadb1eacd7bc6c32 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 1 Jun 2023 21:55:33 +0200 Subject: [PATCH] neon: Fix image background antialiasing --- .../neon/lib/src/widgets/image_wrapper.dart | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/neon/neon/lib/src/widgets/image_wrapper.dart b/packages/neon/neon/lib/src/widgets/image_wrapper.dart index 69fe4005..de44bc39 100644 --- a/packages/neon/neon/lib/src/widgets/image_wrapper.dart +++ b/packages/neon/neon/lib/src/widgets/image_wrapper.dart @@ -15,14 +15,17 @@ class NeonImageWrapper extends StatelessWidget { final BorderRadius? borderRadius; @override - Widget build(final BuildContext context) => SizedBox.fromSize( - size: size, - child: ClipRRect( - borderRadius: borderRadius ?? BorderRadius.zero, - child: ColoredBox( - color: color, - child: Center( - child: child, + Widget build(final BuildContext context) => ClipRRect( + borderRadius: borderRadius ?? BorderRadius.zero, + child: ColorFiltered( + colorFilter: ColorFilter.mode(color, BlendMode.dstATop), + child: SizedBox.fromSize( + size: size, + child: ColoredBox( + color: Colors.transparent, + child: Center( + child: child, + ), ), ), ),