# Remove invalid parameters for `InputDecoration.collapsed`

> 'InputDecoration.collapsed' constructor parameters 'floatingLabelBehavior' and 'floatingLabelAlignment' are deprecated without replacement because they have no effect.




:::important
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.

这些破坏性改动文档的准确性仅限于其发布时对应的版本。
随着时间的推移，文档中描述的方案可能会逐渐失效。
通常情况下，我们不会在每次发布新版本时都对这些文档进行同步更新。

The [breaking change index file](/release/breaking-changes)
lists the docs created for each release.

[破坏性改动列表](/release/breaking-changes) 
列出了每个版本的文档。

:::


## 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:

```dart
InputDecoration.collapsed(
  hintText: 'Hint',
  floatingLabelAlignment: FloatingLabelAlignment.center,
  floatingLabelBehavior: FloatingLabelBehavior.auto,
),
```

Code after migration:

```dart
InputDecoration.collapsed(
  hintText: 'Hint',
),
```

## Timeline

Landed in version: 3.24.0-0.1.pre<br>
In stable release: 3.27.0

## References

API documentation:

* [`InputDecoration.collapsed`][]
* [`InputDecoration.floatingLabelAlignment`][]
* [`InputDecoration.floatingLabelBehavior`][]

Relevant issues:

* [Add prefixIcon and suffixIcon parameters to InputDecoration.collapsed][]

Relevant PRs:

* [Deprecate invalid InputDecoration.collapsed parameters][]
* [Cleanup InputDecoration.collapsed constructor][]

[`InputDecoration.collapsed`]: https://api.flutter-io.cn/flutter/material/InputDecoration/InputDecoration.collapsed.html
[`InputDecoration.floatingLabelAlignment`]: https://api.flutter-io.cn/flutter/material/InputDecoration/floatingLabelAlignment.html
[`InputDecoration.floatingLabelBehavior`]: https://api.flutter-io.cn/flutter/material/InputDecoration/floatingLabelBehavior.html

[Add prefixIcon and suffixIcon parameters to InputDecoration.collapsed]: https://github.com/flutter/flutter/issues/61331
[Deprecate invalid InputDecoration.collapsed parameters]: https://github.com/flutter/flutter/pull/152486
[Cleanup InputDecoration.collapsed constructor]: https://github.com/flutter/flutter/pull/152165

