简体   繁体   English

如何更改 flutter 中凸起按钮边框底部的颜色?

[英]How to change color of just the bottom side of the border of raised button in flutter?

How to change color of just one side of the border of a raised button in flutter?如何更改 flutter 中凸起按钮边框一侧的颜色? 在此处输入图像描述

Wrap your raised button within a container.将凸起的按钮包裹在容器中。 And give并给

Container(
decoration : BoxDecoration(
      border: Border(
          bottom: BorderSide(
               width:3,
               color : Colors.yellow
         ),
      ),
      child:RaisedButton()
)
)

Try this one... DecoratedBox( decoration:const BoxDecoration( border: Border( bottom: BorderSide(color: Colors.grey), ), ), child: ElevatedButton( onPressed: () { }, child:const Text('Button'), style: ElevatedButton.styleFrom( elevation: 0, primary: Colors.white, onPrimary: Colors.black ), ), ), ...试试这个... DecoratedBox( decoration:const BoxDecoration( border: Border( bottom: BorderSide(color: Colors.grey), ), ), child: ElevatedButton( onPressed: () { }, child:const Text('Button '), 样式: ElevatedButton.styleFrom( elevation: 0, primary: Colors.white, onPrimary: Colors.black ), ), ), ... 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM