我是Flutter的新手。正在开发一个应用程序中的背景,但无法模拟完全相同的CSS径向渐变效果。这是我要复制的内容:
background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(3,235,255,1) 0%, rgba(152,70,242,1) 100.2% );
以下是我在Flutter中尝试的内容,但没有能够获得相同的效果(肯定缺少上述渐变中许多参数)。
Container(
width: deviceSize.width,
height: deviceSize.height,
decoration: BoxDecoration(
gradient: RadialGradient(
colors: [
Color.fromRGBO(3,235,255,1),
Color.fromRGBO(152,70,242,1)
],
radius: 1.0,
),
boxShadow: [
BoxShadow(blurRadius: 2),
],
),
// child: const Image(
// image: AssetImage(
// 'lib/assets/images/main_background.jpg',
// ),
// fit: BoxFit.cover,
// ),
),
希望能得到任何建议,提前感谢。