移除 `InputDecoration.collapsed` 的无效参数
概述
#`InputDecoration.collapsed` 的无效参数 `floatingLabelBehavior` 和 `floatingLabelAlignment` 已废弃。
背景
#`InputDecoration.collapsed` 构造函数用于创建一个不带标签的极简装饰。
参数 `floatingLabelAlignment` 和 `floatingLabelBehavior` 无效,因为使用 `InputDecoration.collapsed` 创建的输入装饰没有标签。
迁移指南
#要迁移,请在调用 `InputDecoration.collapsed` 构造函数时,移除 `floatingLabelBehavior` 和 `floatingLabelAlignment` 参数的使用。这些参数本来就无效。
迁移前的代码
dart
InputDecoration.collapsed(
hintText: 'Hint',
floatingLabelAlignment: FloatingLabelAlignment.center,
floatingLabelBehavior: FloatingLabelBehavior.auto,
),
迁移后的代码
dart
InputDecoration.collapsed(
hintText: 'Hint',
),
时间线
#发布版本:3.24.0-0.1.pre
稳定版本:3.27.0
参考资料
#API 文档
InputDecoration.collapsed
InputDecoration.floatingLabelAlignment
InputDecoration.floatingLabelBehavior
相关问题
相关 PR