flutter - 将图标与左按钮对齐展开
问题描述
我在颤动中展开按钮时遇到问题,我需要将图标对齐到按钮的左侧,我使用小部件 Row 制作它,因为这是我找到的最佳方式。但是,文本没有正确居中。
SizedBox(
width: double.infinity,
child: RaisedButton(
onPressed: () => {},
color: Colors.blue,
textColor: Colors.white,
child: Row(
children: <Widget>[
Icon(Icons.send),
Expanded(
child: Text('Enviar', textAlign: TextAlign.center)
)
],
)
),
),
结果是
有没有更好的方法来制作具有这种样式的按钮(文本在所有按钮中居中,不仅在它的空间中)?
解决方案
推荐阅读
- java - 在哈希映射中找到最大值对应的键
- amazon-web-services - AWS sam cli:maven 无法使用 helloworld 教程返回版本字符串
- javascript - “溢出-x:隐藏”在移动设备上不起作用
- reactjs - 测试使用 redux 创建的减速器时出现错误
- javascript - Three.js:如何在特定情况下添加自动旋转?
- javascript - How can I make these components navigate to another screen in react?
- flutter - 当应用程序在后台时,来自 Flutter (FCM) 的 Firebase Messaging 插件不会在 iOS 上触发 onMessage 回调
- git - Git忽略文件的某些部分
- android - 获取手动上传到 Firebase 存储的图像文件的 url
- r - 合并 r 中具有相同行名的 2 个数据帧