有人知道如何模糊处于颤动中的Image.Network吗?
Image.network(
user.profileImageUrl,
fit: BoxFit.cover,
),
Center(
child: Text(
user.name,
style: TextStyle(
fontSize: 30,
),
),
)
尝试以下操作:
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),
),
),
);