Browse Source

Merge pull request #347 from provokateurin/fix/image-background-antialiasing

neon: Fix image background antialiasing
pull/348/head
Kate 2 years ago committed by GitHub
parent
commit
a5db95437f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      packages/neon/neon/lib/src/widgets/image_wrapper.dart

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

@ -15,16 +15,19 @@ class NeonImageWrapper extends StatelessWidget {
final BorderRadius? borderRadius;
@override
Widget build(final BuildContext context) => SizedBox.fromSize(
size: size,
child: ClipRRect(
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: color,
color: Colors.transparent,
child: Center(
child: child,
),
),
),
),
);
}

Loading…
Cancel
Save