首页 > 解决方案 > 扩展的 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: () {},
                  ),
                )

有差距

标签: flutter

解决方案


您从ThemeDataButtonTheme继承颜色。更改颜色或使用MaterialButton

提示:将您的按钮包装在展开的小部件中。


推荐阅读