有人知道如何在抖动中模糊Image.Network吗?
Image.network(
user.profileImageUrl,
fit: BoxFit.cover,
),
Center(
child: Text(
user.name,
style: TextStyle(
fontSize: 30,
),
),
)
答案 0 :(得分:0)
尝试以下操作:
double _sigmaX = 0.0; // from 0-10
double _sigmaY = 0.0; // from 0-10
double _opacity = 0.1; // from 0-1.0
Container(
width: 350,
height: 300,
decoration: BoxDecoration(
image: DecorationImage(
image: Image.network(user.profileImageUrl,
fit: BoxFit.cover,
)
),
),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: _sigmaX, sigmaY: _sigmaY),
child: Container(
color: Colors.black.withOpacity(_opacity),
),
),
);