Flutter中未定义命名参数“ colors”

问题描述

最近我升级了flutter SDK,然后升级了LinearGradientRadialGradient 正在显示带有命名参数stopscolorstileMode的错误。

错误是

The named parameter 'stops' isn't defined.
The named parameter 'colors' isn't defined.

我的代码是

RadialGradient(
  radius: 0.5,colors: [Colors.deepPurple,Colors.amberAccent],// this line give a error
  tileMode: TileMode.mirror,)

LinearGradient(
  colors: gradient,// this line give a error
  stops: stops,// this line give a error
  end: Alignment.bottomCenter,begin: Alignment.topCenter,)

颤抖的医生-v:

[✓] Flutter (Channel stable,1.22.1,on Mac OS X 10.15.3 19D76,locale en-GB)
    • Flutter version 1.22.1 at /Users/pkimac/Development/flutter
    • Framework revision f30b7f4db9 (2 days ago),2020-10-08 10:06:30 -0700
    • Engine revision 75bef9f6c8
    • Dart version 2.10.1

注意:此错误产生的是编译时而不是运行时 有什么办法解决这个问题?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)