flutter - 扩展的 Raisebutton 颤振
问题描述
我正在尝试使以下两个凸起的按钮均匀地填充可用宽度。
我的专栏:
Padding(
padding: const EdgeInsets.only(bottom:18.0),
child: Text(
'Which language Do you prefer',
style: TextStyle(
color: Colors.white,
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
ButtonTheme(
minWidth: 150.0,
height: 50.0,
child: RaisedButton(
color: Theme.of(context).primaryColorLight,
child: Text('French'),
onPressed: () {},
),
),
ButtonTheme(
minWidth: 150.0,
height: 50.0,
child: RaisedButton(
color: Theme.of(context).primaryColorLight,
child: Text('English'),
onPressed: () {},
),
)
有差距
解决方案
您从ThemeDataButtonTheme
继承颜色。更改颜色或使用MaterialButton。
提示:将您的按钮包装在展开的小部件中。
推荐阅读
- python - 如何永久设置基本 conda 环境目录?
- python - 如何在 LearningRateScheduler 中参考损失分数
- haskell - Haskell:基于属性的高阶函数测试
- html - 从 html5 相机保存图像
- python - 如何修复 AWS Glue 代码以显示来自 AWS S3 的分区表的计数和架构
- python - 覆盖整个列的数据框
- spring - 使用 spring Batch 从命令行运行器读取参数
- jquery - 如何将 select2 中新创建的标签的值更改为数据库中的新 id
- javascript - 如何在基于反应函数的视图中进行 api 调用和填充
- flutter - 如何使下拉按钮创建的列表形状为圆形?