# Make PageView.controller nullable

> PageView.controller is now nullable.




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

If a controller isn't provided in the constructor,
the `controller` member is `null`. This makes
`PageView` and its `controller` property consistent with other widgets.

## Migration guide

Before:

```dart
pageView.controller.page
```

After:

```dart
pageView.controller!.page
```

## Timeline

Landed in version: 3.19.0-12.0.pre<br>
In stable release: 3.22.0

## References

Relevant issues:

* [PageView uses global controller, that is never disposed. (Issue 141119)][]

[PageView uses global controller, that is never disposed. (Issue 141119)]: https://github.com/flutter/flutter/issues/141119

