How do I add a border to a flutter button?

后端 未结 2 399
难免孤独
难免孤独 2021-01-02 04:51

I\'ve just recently gotten into flutter and am loving it so far but I\'ve gotten stuck on some UI changes. Any help is appreciated!

My goal is to get a circular butt

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-02 05:16

    Just wrap an IconButton into a Container and set its decoration as following:

    Container(
      decoration: BoxDecoration(
        border: Border.all(color: Colors.blue, width: 4),
        color: Colors.yellow,
        shape: BoxShape.circle,
      ),
      child: IconButton(
        iconSize: 56,
        icon: Icon(Icons.check),
        onPressed: () {},
      ),
    ),
    

提交回复
热议问题