如何在 Flutter 中将文本放在 textbutton.icon 的图标下?

mel*_*tra 1 dart flutter flutter-layout

我是编码新手,不确定如何将文本放入实际图标下的 TextButton.icon 中。请问你能帮忙吗?这是代码:

        TextButton.icon(
          onPressed: () => {},
          icon: Icon(
            Icons.add,
            color: Colors.white,
            size: 50,
          ),
          label: Text(
              'Label',
              style: TextStyle(
                color: Colors.white,
              ),
          )),
Run Code Online (Sandbox Code Playgroud)

Aki*_*kif 5

您可以像这样使用Column小部件icon

         TextButton.icon(
              onPressed: () => {},
              icon: Column(
                children: [
                  Icon(
                    Icons.add,
                    color: Colors.red,
                    size: 50,
                  ),
                  Text(
                    'Label',
                    style: TextStyle(
                      color: Colors.red,
                    ),
                  ),
                ],
              ),
              label: Text(
                '', //'Label',
                style: TextStyle(
                  color: Colors.red,
                ),
              ),
            ),
         
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述