Flutter之LinearGradient组件

/**
可以实现背景颜色渐变
 * const LinearGradient({
    this.begin = Alignment.centerLeft,
    this.end = Alignment.centerRight,
    @required List colors,//颜色取值
    List stops,
    this.tileMode = TileMode.clamp,
    GradientTransform transform,
  })
*/
decoration: BoxDecoration(
                    gradient: LinearGradient(
                        colors: [Color(HexColor.getColorFromHex(info['classifycolorright'])), Color(HexColor.getColorFromHex(info['classifycolor']))]
                    )
                ),

你可能感兴趣的:(Flutter之LinearGradient组件)