概述

#

InputDecoration.collapsed 中的 `floatingLabelBehavior` 和 `floatingLabelAlignment` 参数已弃用,并且无效。

背景

#

InputDecoration.collapsed 构造函数用于创建一个没有标签的最小化装饰。

由于使用 InputDecoration.collapsed 创建的输入装饰没有标签,因此 floatingLabelAlignmentfloatingLabelBehavior 参数不起任何作用。

迁移指南

#

要进行迁移,请在调用 InputDecoration.collapsed 构造函数时移除 floatingLabelBehaviorfloatingLabelAlignment 参数的使用。这些参数原本就没有起到任何作用。

迁移前的代码

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 文档

相关问题

相关 PR