【问题标题】:How to give checkbox gradient in flutter?如何在颤动中给出复选框渐变?
【发布时间】:2021-05-11 12:05:37
【问题描述】:

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

【问题讨论】:

    标签: android flutter dart


    【解决方案1】:

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

    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,),
                ),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-01
      • 2020-08-26
      • 2019-02-09
      • 2019-10-19
      • 1970-01-01
      • 2021-02-02
      • 2020-05-01
      • 2022-01-25
      相关资源
      最近更新 更多