# Bottom Navigation Title To Label

> Deprecated BottomNavigationBarItem's title (a Widget) in favor of label (a String).




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

`BottomNavigationBarItem.title` gives a deprecation warning,
or no longer exists when referenced in code.

## Context

`BottomNavigationBarItem`s `title` parameter was deprecated
in favor of `label`. This change was necessary to improve
the user experience of `BottomNavigationBar`s when the text
scale factor is increased. Items in a `BottomNavigationBar`
now show tooltips on long press. Accomplishing this
requires a `String` parameter on `BottomNavigationBarItem`s.

## Description of change

The `BottomNavigationBarItem` class has a `title` parameter,
which is a `Widget`. This made it impossible for the
`BottomNavigationBar` to show `Tooltip` widgets,
a change that was necessary to improve the accessibility experience.
Now, instead of building the `BottomNavigationBarItem.title`
widget, the BottomNavigationBar wraps the
`BottomNavigationBarItem.label` in a Text widget and builds that.

## Migration guide

Code before migration:

```dart
BottomNavigationBarItem(
  icon: Icons.add,
  title: Text('add'),
)
```

Code after migration:

```dart
BottomNavigationBarItem(
  icon: Icons.add,
  label: 'add',
)
```

## Timeline

Landed in version: 1.22.0<br>
In stable release: 2.0.0

## References

API documentation:

* [`BottomNavigationBarItem`][]

Relevant PRs:

* [PR 60655][]: Clean up hero controller scope
* [PR 59127][]: Update BottomNavigationBar to show tooltips on long press.

Breaking change proposal:

* [Breaking Change: Bottom Navigation Item Title][]


[`BottomNavigationBarItem`]: https://api.flutter-io.cn/flutter/widgets/BottomNavigationBarItem-class.html
[Breaking Change: Bottom Navigation Item Title]: /go/bottom-navigation-bar-title-deprecation
[PR 59127]: https://github.com/flutter/flutter/pull/59127
[PR 60655]: https://github.com/flutter/flutter/pull/60655

