Browse Source

neon: Fix image background antialiasing

pull/347/head
jld3103 2 years ago
parent
commit
b2b5b94a9c
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 19
      packages/neon/neon/lib/src/widgets/image_wrapper.dart

19
packages/neon/neon/lib/src/widgets/image_wrapper.dart

@ -15,14 +15,17 @@ class NeonImageWrapper extends StatelessWidget {
final BorderRadius? borderRadius; final BorderRadius? borderRadius;
@override @override
Widget build(final BuildContext context) => SizedBox.fromSize( Widget build(final BuildContext context) => ClipRRect(
size: size, borderRadius: borderRadius ?? BorderRadius.zero,
child: ClipRRect( child: ColorFiltered(
borderRadius: borderRadius ?? BorderRadius.zero, colorFilter: ColorFilter.mode(color, BlendMode.dstATop),
child: ColoredBox( child: SizedBox.fromSize(
color: color, size: size,
child: Center( child: ColoredBox(
child: child, color: Colors.transparent,
child: Center(
child: child,
),
), ),
), ),
), ),

Loading…
Cancel
Save