Skip to content

Conversation

@flutteractionsbot
Copy link

@flutteractionsbot flutteractionsbot commented Oct 8, 2025

This pull request is created by automatic cherry pick workflow
Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request.

Issue Link:

What is the link to the issue this cherry-pick is addressing?

#174082

Changelog Description:

Explain this cherry pick in one line that is accessible to most Flutter developers. See best practices for examples

#174082 Apps, on all platforms, that extend MenuController class see a compile time failure when building.

Impact Description:

What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch)

Apps that used to rely on extended MenuControllers won't build.

Workaround:

Is there a workaround for this issue?

The app will have to modify their local Flutter repository. Otherwise, if the app really rely on extending the MenuController class to do custom logic, I can think of no ways for them to continue this customization under this restriction.

Risk:

What is the risk level of this cherry-pick?

  • Low
  • Medium
  • High

Test Coverage:

Are you confident that your fix is well-tested by automated tests?

  • Yes
  • No

Validation Steps:

What are the steps to validate that this fix works?

The following snippet builds.

import 'package:flutter/material.dart';

class ExtendedMenuController extends MenuController {
  ExtendedMenuController();
}

fix: remove final class modifier on MenuController
fixes: flutter#174082 

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
@flutteractionsbot flutteractionsbot added the cp: review Cherry-picks in the review queue label Oct 8, 2025
@flutteractionsbot
Copy link
Author

@dkwingsmt please fill out the PR description above, afterwards the release team will review this request.

@flutter-dashboard
Copy link

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 8, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the final modifier from the MenuController class, allowing it to be extended. A corresponding test case has been added to verify that MenuController can be subclassed and its methods overridden. The changes are correct and well-tested. I've added a couple of suggestions to improve documentation in the new test code to align with the Flutter style guide.

Comment on lines +2907 to +2908
// Custom MenuController that extends the base MenuController
// This verifies that the final modifier has been removed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the Flutter Style Guide, it's recommended to use /// for documentation, even for test-only classes. This improves readability and maintainability.

Ref: Flutter Style Guide - Documentation (line 62).

Suggested change
// Custom MenuController that extends the base MenuController
// This verifies that the final modifier has been removed
/// A custom [MenuController] that extends the base [MenuController] to verify
/// that the `final` modifier has been removed.

Comment on lines +2910 to +2911
int openCallCount = 0;
int closeCallCount = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the Flutter Style Guide, all public members should have documentation. Please add doc comments for these fields to improve code clarity.

Ref: Flutter Style Guide - Documentation (line 53).

Suggested change
int openCallCount = 0;
int closeCallCount = 0;
/// The number of times [open] has been called.
int openCallCount = 0;
/// The number of times [close] has been called.
int closeCallCount = 0;

@reidbaker
Copy link
Contributor

@dkwingsmt can you update the pr description to a changelog that meets our guidelines.

@justinmc for framework approval + autosubmit.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 . And confirmed that this is a high value low risk thing to cherry pick.

@reidbaker reidbaker added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 21, 2025
@auto-submit auto-submit bot merged commit 284ec68 into flutter:flutter-3.35-candidate.0 Oct 21, 2025
139 checks passed
@dkwingsmt
Copy link
Contributor

@reidbaker Can you tell me where it doesn't meet? I specifically read the guideline before writing the current one.

@reidbaker
Copy link
Contributor

The MenuController class is marked final and breaks apps that extend this class.

https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md

"What the scenario is (describe the problem). What platforms it affects. In what context it may occur. How likely it is to occur"
and
"When $scenario [on $platform], $problem_description"

Here is my attempt at following the guidelines.

flutter/174082 Apps, on all platforms, that extend MenuController class see a compile time failure when building.

Starts with the issue, describes where in the developers code would be impacted, describes the problem in the state prior to being fixed and describes what platforms are impacted.

@dkwingsmt
Copy link
Contributor

I see. Yeah, I thought I would skip the platforms since they apply to all platforms. Thank you.

@reidbaker
Copy link
Contributor

No worries you are far from the first person to be confused.
I put up #177333 to try to make it easier for cherry pick requesters.

@reidbaker
Copy link
Contributor

I see. Yeah, I thought I would skip the platforms since they apply to all platforms. Thank you.

The issue is users dont actually think that no platform information means all platforms.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants