# Deprecate `InputDecoration.maintainHintHeight` in favor of `InputDecoration.maintainHintSize`

> The `InputDecoration.maintainHintHeight` parameter has been replaced by `InputDecoration.maintainHintSize`.




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

The [`InputDecoration.maintainHintHeight`][] parameter was deprecated
in favor of the [`InputDecoration.maintainHintSize`][] parameter.

## Context

The default intrinsic size of an input decorator depends on the hint size.
The [`InputDecoration.maintainHintSize`][] parameter can be set to `false` to
make the intrinsic size ignores the hint size when the hint isn't visible.
Previously, the `InputDecoration.maintainHintHeight` parameter was
used to override the default intrinsic height and had no impact on the
intrinsic width.

## Description of change

The [`InputDecoration.maintainHintHeight`][] is deprecated in
favor of [`InputDecoration.maintainHintSize`][] which makes both the intrinsic
width and height depend on the hint dimensions.

## Migration guide

Replace [`InputDecoration.maintainHintHeight`][] with
[`InputDecoration.maintainHintSize`][] to override the default intrinsic size
computation.

Code before migration:

```dart highlightLines=3
TextField(
  indicator: InputDecoration(
    maintainHintHeight: false,
  ),
),
```

Code after migration:

```dart highlightLines=3
TextField(
  indicator: InputDecoration(
    maintainHintSize: false,
  ),
),
```

## Timeline

Landed in version: 3.30.0-0.0.pre<br>
In stable release: 3.32

## References

API documentation:

- [`InputDecoration.maintainHintHeight`][]
- [`InputDecoration.maintainHintSize`][]

Relevant issues:

- [Issue #93337][]

Relevant PRs:

- [Fix TextField intrinsic width when hint is not visible][]

[`InputDecoration.maintainHintHeight`]: https://api.flutter-io.cn/flutter/material/InputDecoration/maintainHintHeight.html
[`InputDecoration.maintainHintSize`]: https://main-api.flutter-io.cn/flutter/material/InputDecoration/maintainHintSize.html
[Issue #93337]: https://github.com/flutter/flutter/issues/93337
[Fix TextField intrinsic width when hint is not visible]: https://github.com/flutter/flutter/pull/161235

