【发布时间】:2019-09-28 16:06:49
【问题描述】:
【问题讨论】:
【问题讨论】:
试试这个:
Container(
height: 100,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Colors.black,
Colors.purple,
Colors.blue,
Colors.green,
Colors.brown,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [0.01, 0.3, 0.4, 0.8, 1],
),
),
)
您已经有了颜色,您必须创建 stops,这在我的示例中是不言自明的,并且必须与颜色具有相同的长度。
如果要使其水平,请调整 begin 和 end 参数。
【讨论】: