How to left align the OutlineButton icon in Flutter

后端 未结 2 1531
醉话见心
醉话见心 2021-02-20 12:41

How to left align the OutlineButton icon in Flutter? Icon can be added as follows, but both icon and text are centered aligned in the button. Is there

2条回答
  •  北恋
    北恋 (楼主)
    2021-02-20 13:13

    There are common approaches you can try, I have implemented this :

       OutlineButton(
            onPressed: () => null,
            child: Stack(
              alignment: Alignment.centerLeft,
              children: [
                Icon(Icons.save_alt_rounded),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text('Title'),
                  ],
                ),
              ],
            ),
            highlightedBorderColor: Colors.orange,
            color: Colors.green,
            borderSide: new BorderSide(color: Colors.green),
            shape: new RoundedRectangleBorder(
                borderRadius: new BorderRadius.circular(5.0)
            )
        );
    

提交回复
热议问题