flutter - How to make a raised button that has a gradient background?

后端 未结 10 1688
野性不改
野性不改 2021-01-31 14:52

Is there a way to change the raised button background color to a gradient? if not, how can I achieve something like this?

10条回答
  •  悲&欢浪女
    2021-01-31 15:38

    Gradient package is available at pub store which supports few predefined gradients

    You can create the gradient button as

    GradientButton(
                     child: Text('Gradient'),
                     callback: () {},
                     gradient: Gradients.backToFuture,
               ),
    

    The package have GradientCard, GradientProgressIndicator, GradientButton, CircularGradientButton and the GradientText

    Gradient Widgets

提交回复
热议问题