Skip to content

Document super call order for State.didChangeDependencies - #185945

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
fahaddoc:fix/28925-didchangedependencies-super-doc
Aug 5, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
fahaddoc:fix/28925-didchangedependencies-super-doc

Conversation

@fahaddoc

@fahaddoc fahaddoc commented May 3, 2026

Copy link
Copy Markdown
Contributor

The doc comment on State.didChangeDependencies is silent about where overrides should place the super.didChangeDependencies() call, even though @mustCallSuper is set on it. The sibling lifecycle hook State.initState already documents this convention, so the two methods read inconsistently and contributors hitting didChangeDependencies for the first time have to guess.

This PR adds a short note to the dartdoc that mirrors the wording on initState, telling implementations to start with a call to the inherited method (super.didChangeDependencies()). It is a documentation-only change to packages/flutter/lib/src/widgets/framework.dart. There is no behavior change, no API change, and no new public surface.

Fixes #28925.

Pre-launch Checklist

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

didChangeDependencies docs don't specify where to call super

4 participants