Flutter將圖標按鈕對齊到行中的右側

這是我的密碼;

SizedBox(
        width: size.width,
        child: Row(
          children: [
            Padding(
              padding: const EdgeInsets.only(left: 10, bottom: 10, top: 10),
              child: ClipRRect(
                borderRadius: BorderRadius.circular(100),
                child: Image.asset(
                  'assets/images/me.png',
                  height: 30,
                  width: 30,
                  fit: BoxFit.cover,
                ),
              ),
            ),
            const Padding(
              padding: EdgeInsets.only(left: 10),
              child: Text(
                'samet',
                textAlign: TextAlign.center,
                style: TextStyle(fontSize: 16),
              ),
            ),
            IconButton(
              // padding: const EdgeInsets.only(left: 250),
              onPressed: () {},
              icon: const Icon(Icons.more_horiz),
              iconSize: 30,
              alignment: Alignment.centerRight,
              splashColor: Colors.transparent,
              highlightColor: Colors.transparent,
            )
          ],
        ),
      ),

這里是輸出;

我查看了其他StackOverflow問題,但找不到答案。我不能用onPressed功能更改圖標Button的顏色。我創建了Color _color的變量,并使iconButton屬性Color={@112},在onPressed中我打開了setState函數,當我按下時它不會改變。

IconButton(
              // padding: const EdgeInsets.only(left: 250),
              color: _iconColor,
              onPressed: () {
                setState(() {
                  _iconColor = Colors.red;
                });
              },
              icon: const Icon(Icons.more_horiz),
              iconSize: 30,
              alignment: Alignment.centerRight,
              splashColor: Colors.transparent,
              highlightColor: Colors.transparent,
            )
? 最佳回答:

如何右對齊圖標按鈕

您可以使用Expanded來占用其間的額外空間。

const Padding(
              padding: EdgeInsets.only(left: 10),
              child: Text(
                'samet',
                textAlign: TextAlign.center,
                style: TextStyle(fontSize: 16),
              ),
            ),
            Expanded(child: Container()),
            IconButton(
              // padding: const EdgeInsets.only(left: 250),
              onPressed: () {},
              icon: const Icon(Icons.more_horiz),
              iconSize: 30,
              alignment: Alignment.centerRight,
              splashColor: Colors.transparent,
              highlightColor: Colors.transparent,
            ),
            
          ],
主站蜘蛛池模板: 亚洲日韩一区精品射精| 亚洲Av无码一区二区二三区| 国产AV一区二区三区传媒| 亚洲精品日韩一区二区小说| 国产伦精品一区二区三区视频金莲 | 蜜芽亚洲av无码一区二区三区| 久久影院亚洲一区| 国产SUV精品一区二区88L| 亚洲国产激情在线一区| 日本亚洲成高清一区二区三区| 日本一区二区三区不卡视频中文字幕 | 3D动漫精品一区二区三区| 中文乱码精品一区二区三区| 国产综合精品一区二区| 久久久久人妻一区二区三区| 久久久久无码国产精品一区| 国产精品男男视频一区二区三区| 日韩美女在线观看一区| 亚洲AV成人精品日韩一区| 亚洲欧美日韩一区二区三区在线| 美女一区二区三区| 亚洲一区二区成人| 无码av免费一区二区三区| 国产精品高清一区二区三区 | 久久久精品人妻一区亚美研究所| 好吊视频一区二区三区| 国产福利电影一区二区三区久久老子无码午夜伦不 | 福利一区在线视频| 国产成人av一区二区三区在线 | 国产精品主播一区二区| 波霸影院一区二区| 乱人伦一区二区三区| 国产天堂一区二区综合| 中文字幕一区二区人妻| 国产精品区一区二区三在线播放| 国产精品一区二区久久国产| 日本一区二区在线| 精品国产一区二区三区不卡 | 一区一区三区产品乱码| 成人区人妻精品一区二区三区| 日本福利一区二区|