Created
October 27, 2024 18:17
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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