Remove invalid parameters for `InputDecoration.collapsed`
Summary
#InputDecoration.collapsed
invalid parameters floatingLabelBehavior
and
floatingLabelAlignment
are deprecated.
Background
#InputDecoration.collapsed
constructor is used to create a minimal decoration
without label.
The parameters floatingLabelAlignment
and floatingLabelBehavior
have
no effect because an input decoration created using InputDecoration.collapsed
has no label.
Migration guide
#To migrate, remove usage of floatingLabelBehavior
and floatingLabelAlignment
parameters when calling InputDecoration.collapsed
constructor.
Those parameters had no effect.
Code before migration:
InputDecoration.collapsed(
hintText: 'Hint',
floatingLabelAlignment: FloatingLabelAlignment.center,
floatingLabelBehavior: FloatingLabelBehavior.auto,
),
Code after migration:
InputDecoration.collapsed(
hintText: 'Hint',
),
Timeline
#Landed in version: v3.24.0-0.1.pre
In stable release: Not yet
References
#API documentation:
InputDecoration.collapsed
InputDecoration.floatingLabelAlignment
InputDecoration.floatingLabelBehavior
Relevant issues:
Relevant PRs:
- Deprecate invalid InputDecoration.collapsed parameters
- Cleanup InputDecoration.collapsed constructor
除非另有说明,本文档之所提及适用于 Flutter 的最新稳定版本,本页面最后更新时间: 2024-10-09。 查看文档源码 或者 为本页面内容提出建议。