Skip to content

Instantly share code, notes, and snippets.

@tech-andgar
Created October 27, 2024 18:17
Show Gist options
  • Select an option

  • Save tech-andgar/37f804cc1ba1893717234ccea063a112 to your computer and use it in GitHub Desktop.

Select an option

Save tech-andgar/37f804cc1ba1893717234ccea063a112 to your computer and use it in GitHub Desktop.
`ImageFilter.blur` Causes Artifacts on Android, iOS, and macOS but Not on Web
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
body: Center(
child: BlurredCircle(),
),
),
));
}
class BlurredCircle extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ImageFiltered(
imageFilter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.black.withOpacity(0.4),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment