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 a 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 the 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: 3.24.0-0.1.pre
In stable release: 3.27.0
References
#API documentation:
InputDecoration.collapsedInputDecoration.floatingLabelAlignmentInputDecoration.floatingLabelBehavior
Relevant issues:
Relevant PRs:
除非另有说明,否则本网站上的文档反映的是 Flutter 的最新稳定版本。页面最后更新于 2025-01-30。 查看源代码 或 报告问题。