Flutter 3.41 is live! Check out theFlutter 3.41 blog post!
Remove invalid parameters forInputDecoration.collapsed
'InputDecoration.collapsed' constructor parameters 'floatingLabelBehavior' and 'floatingLabelAlignment' are deprecated without replacement because they have no effect.
These breaking change docs are accurate, as of the release under which they are published. Over time, the workarounds described here might become inaccurate. We don't, in general, keep these breaking change docs up to date as of each release.
Thebreaking change index file lists the docs created for each release.
Summary
#InputDecoration.collapsed invalid parametersfloatingLabelBehavior andfloatingLabelAlignment are deprecated.
Background
#InputDecoration.collapsed constructor is used to create a minimal decoration without a label.
The parametersfloatingLabelAlignment andfloatingLabelBehavior have no effect because an input decoration created usingInputDecoration.collapsed has no label.
Migration guide
# To migrate, remove usage offloatingLabelBehavior andfloatingLabelAlignment parameters when calling theInputDecoration.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:
Unless stated otherwise, the documentation on this site reflects Flutter 3.38.6. Page last updated on 2025-10-28.View source orreport an issue.