如何在颤振中给出复选框渐变?

时间:2021-05-11 12:05:37

标签: android flutter dart

有没有办法在颤振中实现带有渐变的复选框?我尝试使用 Checkbox 类但无法实现线性渐变?我该怎么办?

1 个答案:

答案 0 :(得分:0)

你可以用容器包裹它并像这样改变高度和宽度:

Container(height: 19,
              width: 19,
              decoration: BoxDecoration(
                  gradient: LinearGradient(
                    begin: Alignment.topLeft, 
                    end: Alignment(10, 3), 
                    colors: <Color>[
                      Colors.white, 
                      Colors.grey,
              ],
            )
            ),
              child: Checkbox(value: false,),
            ),