简体   繁体   English

闪屏中的闪屏渐变颜色

[英]Splash Screen gradient Color in flutter

How Can I make Splash Screen with gradient colors in flutter?如何在颤动中制作带有渐变颜色的启动画面?

I use splash_screen_view: ^3.0.0 and I'm trying to add this code ti its Container but it's make an error我使用splash_screen_view: ^3.0.0并且我正在尝试将此代码添加到它的Container中,但它出错了

decoration: BoxDecoration(
  gradient: RadialGradient(
  radius: 2.5,
  stops: [
   0.0,
   0.50,
  ],
  colors: [
   Color.fromRGBO(7, 71, 99, 1),
   Color.fromRGBO(8, 28, 49, 1),
  ],
 ),
),

and another code doesn't work另一个代码不起作用

decoration: BoxDecoration(
  color: const [
  Color.fromRGBO(8, 28, 49, 1),
  Color.fromRGBO(7, 71, 99, 1),
 ]
),

one option is to generate gradient image for example here and than set it as background image in pubspec.yaml config like this:例如,一种选择是在此处生成渐变图像,然后在pubspec.yaml配置中将其设置为背景图像,如下所示:

splash_screen_view:
  background_image: "assets/your_gradient_image.png"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM