android - Flutter/Dart, Switch:又抛出一个异常:A RenderFlex 右侧溢出 99640 像素
问题描述
我目前正在尝试向我的 android 应用程序的设置页面添加一个开关。但是,当我添加代码并尝试在模拟器上查看它时,会引发以下错误:
抛出了另一个异常:A RenderFlex 在右侧溢出了 99640 像素。
代码:
Container(
decoration: BoxDecoration (
color: Colors.white,
border: Border(
bottom: BorderSide(width: 1.0, color: Colors.grey)
),
),
constraints: BoxConstraints (
maxHeight: ((width * ratio) * 0.1),
minWidth: width,
maxWidth: width,
),
child: Row(
children: <Widget>[
Expanded(
child: Padding(
padding: EdgeInsets.only(left: (width*ratio) * 0.025),
child: Text('Highlight Identical Numbers', style: TextStyle(color: Colors.black87, fontSize: fontTextTwoScale, fontFamily: 'Roboto'))
)
),
Container(
child: Switch(value: null, onChanged: null,)
),
],
),
),
我正在尝试对其进行设置,以使文本与屏幕左侧对齐,并且开关与右侧对齐。我不明白小部件如何溢出 99640 像素。我没有看到 Switch 的尺寸选项。
解决方案
推荐阅读
- python - 重写相同的代码得到不同的结果
- pandas - © 而不是 é 保存在 utf-8 文件中
- python - 在 Pandas Dataframe 中查找具有特定值的连续数据周期,并将它们分组为子数据帧
- c++ - 如何在 C++ 中将十六进制字符串转换为文本数据
- firebase - 是什么阻止了用户从 Firestore 中读取一百万次
- jmeter - 了解 JMeter 中的启动时间
- javascript - 如何从 WebView 中逃脱
- python - 在mysql数据库中插入“+”符号
- javascript - 生成数组Javascript的自定义对象
- django - 从 django 获取 url 的完整路径(不是 django 模板)