This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
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?
https://github.com/flutter/flutter/issues/168936.
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
Fixes a "Null check operator used on a null value" crash when a scroll view contains a `LayoutBuilder`.
### 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)
The app may crash if there a `LayoutBuilder` child inside of a `RenderSliverMultiBoxAdaptor` (which `SliverList` uses), and that child suddenly becomes offstage and kept-alive.
One example is when you have a TextField inside of a LayoutBuilder which is part of a `SliverList`. The app crashes ("Null check operator used on a null value") even in release mode when the user drags so that the text field becomes offscreen. All 3 are popular widgets so I think this combination will not be that uncommon.
### Workaround:
Is there a workaround for this issue?
There's no known workaround for this issue. You can increase the cache extent to prevent the child from becoming kept-alive but this is not really feasible for long / infinite list as it will go OOM fast.
### Risk:
What is the risk level of this cherry-pick?
This should be a relatively safe fix.
Despite changing an important flag in RenderObject from `RenderObject?` to `bool?`, there's only one change in behavior:
in `RenderObject.dropChild`: https://github.com/flutter/flutter/pull/169958/files#diff-4c298197a8aa7831a26eece096c8b8b07773ba1f5376d848ea4ef2924b606e9fL2052
which originally set the flag to `null` for the entire subtree until a new relayout boundary is reached, now it only sets the flag to `null` for the root of the subtree.
In release mode, the only place the framework cares about whether the flag is null is [here](https://github.com/flutter/flutter/pull/169958/files#diff-4c298197a8aa7831a26eece096c8b8b07773ba1f5376d848ea4ef2924b606e9fR2342) (everywhere else `null` just means `false`), and that won't actually introduce any correctness issues because if the node originally enters the `if` block in line 2343 it will still enter the `if` block after the patch.
Also, the fix was merged a couple weeks ago and I haven't seen bug reports associated with the fix yet.
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
What are the steps to validate that this fix works?
follow the repro steps in https://github.com/flutter/flutter/issues/168936, or
run the test (already checked in in `master`)
```dart
testWidgets('LayoutBuilder does not crash when it becomes kept-alive', (
WidgetTester tester,
) async {
final FocusNode focusNode = FocusNode();
final TextEditingController controller = TextEditingController();
addTearDown(focusNode.dispose);
addTearDown(controller.dispose);
final Widget layoutBuilderWithParent = SizedBox(
key: GlobalKey(),
child: LayoutBuilder(
builder: (BuildContext _, BoxConstraints _) {
// The text field keeps the widget alive in the SliverList.
return EditableText(
focusNode: focusNode,
backgroundCursorColor: const Color(0xFFFFFFFF),
cursorColor: const Color(0xFFFFFFFF),
style: const TextStyle(),
controller: controller,
);
},
),
);
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: CustomScrollView(
slivers: <Widget>[
SliverList.list(
addRepaintBoundaries: false,
addSemanticIndexes: false,
children: <Widget>[const SizedBox(height: 60), layoutBuilderWithParent],
),
],
),
),
);
focusNode.requestFocus();
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
child: CustomScrollView(
slivers: <Widget>[
SliverList.list(
addRepaintBoundaries: false,
addSemanticIndexes: false,
children: <Widget>[const SizedBox(height: 6000), layoutBuilderWithParent],
),
],
),
),
);
});
```
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
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?
https://github.com/flutter/flutter/issues/169249https://github.com/flutter/flutter/issues/169436
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
NavigationBar active indicator animation gets stucked.
### 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)
Visual glitch visible by users. In several scenarios, the active indicator for NavigationBar and NavigationDrawer is not properly painted (animation stucked half way or active color not reflecting the current state).
### Workaround:
Is there a workaround for this issue?
No
### Risk:
What is the risk level of this cherry-pick?
- [ x ] Low
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
- [ x ] Yes
### Validation Steps:
What are the steps to validate that this fix works?
Run the code sample from https://github.com/flutter/flutter/issues/169249.
This fix is a revert to a PR which landed in the current stable.
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
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?
https://github.com/flutter/flutter/issues/169175
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
Fixed unexpected crash when using Tab and TabBar widgets.
### 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)
app crash
### Workaround:
Is there a workaround for this issue?
Wrap the Tab widget with a MergeSemantics widget will mitigate the issue.
### Risk:
What is the risk level of this cherry-pick?
- [O] Low
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
- [O] Yes
### Validation Steps:
What are the steps to validate that this fix works?
create a TabBar that has a Tab with image widget
```dart
TabBar(
tabs: <Widget>[
Tab(icon: Image.network('https://some-url')),
Tab(icon: Icon(Icons.beach_access_sharp)),
Tab(icon: Icon(Icons.brightness_5_sharp)),
],
),
```
### Issue Link:
What is the link to the issue this cherry-pick is addressing?
https://github.com/flutter/flutter/issues/168846
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
This cherry pick fixes an issue where some users would see a question mark instead of the appropriate icon in the widget inspector button which toggles select-mode on/off.
### Impact Description:
Users who don't have `cupertino_icons` as a dependency in their pubspec will see a question mark in one of the widget inspector buttons.
<img width="169" alt="Screenshot 2025-05-19 at 12 50 15 PM" src="https://github.com/user-attachments/assets/40cd01c9-f8a6-407d-9d1b-303bc1516d62" />
### Workaround:
Is there a workaround for this issue?
Yes, add `cupertino_icons` package to user's pubspec.
### Risk:
What is the risk level of this cherry-pick?
Low
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
This was tested manually, there are no screenshot tests for this. However, this is only a UI change and not a behavior change.
### Validation Steps:
What are the steps to validate that this fix works?
1. Run an app that doesn't have `cupertino_icons` in its pubspec
2. Open Flutter DevTools > Inspector
3. Enable select widget mode
4. Should not see a ? on any of the buttons
### CP request for https://github.com/flutter/flutter/pull/167677 into flutter-3.32-candidate.0
**Impacted Users:** Some subset of widget inspector users with a specific configuration of `package:go_router`, see upvotes and comments on https://github.com/flutter/flutter/issues/166118.
**Impact Description:** Depending on how users have configured their routes using `package:go_router`, enabling / disabling the widget inspector can be destructive to their app's routing state, preventing them from inspecting widgets on secondary screens of their app.
**Workaround:** No workaround available.
**Risk:** Low
**Test Coverage:** Yes, tests were added and this has been manually tested as well
**Validation Steps:**
- Run a Flutter app
- Open the DevTools Inspector for the running app
- Toggle "Select widget mode"
- An additional button has been added to the on-device inspector that allows developers to both interact with their app (e.g. navigate to a new page) and select widgets while in Widget Selection mode. See gif below.

This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request)
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?
https://github.com/flutter/flutter/issues/167247
We identified a breaking change in beta, this change un-breaks it.
### Changelog Description:
Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples
Restore RenderConstrainedLayoutBuilder with default layoutInfo implementation to undo a breaking change.
### 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)
A class was renamed, which left developers with a "class not found" error as their only guide.
### Workaround:
Is there a workaround for this issue?
Nope.
### Risk:
What is the risk level of this cherry-pick?
### Test Coverage:
Are you confident that your fix is well-tested by automated tests?
### Validation Steps:
What are the steps to validate that this fix works?
Classes that mixin RenderConstrainedLayoutBuilder are no longer broken and the code can compile.
Fix: CupertinoSheetTransition should set the SystemUIOverlayStyle in
init state
fixes: #164633
Fixes https://github.com/flutter/flutter/issues/164134
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Feat: Add yearShape property to DatePickerThemeData
fixes: #163340
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
---------
Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>
## Description
This PR fixes a focus traversal issue for read-only TextField on macOS.
# Implementation details
On macOS, some editing capabilities are handled differently compared to
other platforms.
Since https://github.com/flutter/flutter/pull/105407, the macOS engine
send editing selectors to the framework.
To do so a text input connection should be opened.
Before this PR there was no text input connection for a read-only
EditableText which means several shortcut were not handled, especially
tab traversal (but also selection shortcuts using arrows).
After this PR an input connection is always created on macOS even if an
EditableText is read-only.
## Related Issue
Fixes [Read-only TextField prevents focus from
changing](https://github.com/flutter/flutter/issues/161482)
## Tests
Adds 1 test.
Refactor: Migrate to Theme.brightnessOf method
fixes: #163837
## 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.
- [x] 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.
Fix: Range slider show overlay for both thumbs on hovering one
fixes: #165281
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Unfortunately `10_google3_bug.yml` comes before `2_bug.yml`.
This changes the name (slightly) of the issue templates based on the
instructions from GitHub on what to do when you have 10+ issue templates
(as a side-note: I wonder if we need/still use umbrella bugs for the
feature tracker, or two types of performance bugs)
Fix: Hero animation for page transition
fixes: #163989
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Fix: DelegateTransition for cupertino sheet route
fixes: #163954
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Feat: Add brightnessOf method for theme
fixes: #163393
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
Refactor: Migrate Date picker from MaterialState and
MaterialStateProperty to WidgetState and WidgetStateProperty
Part 1 of: #161052
Part 2 will contain addition of `selectedBackgroundColor` and
`selectedForegroundColor` which fully adds the requested feature.
## 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.
- [x] 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.
**Description**
This pull request fixes a minor documentation issue in the SliverList
reference, where a missing closing bracket ] in the ListView reference
could lead to confusion when reading the docs.
By correcting this, we improve the readability and clarity of the
documentation for Flutter developers referencing the SliverList widget.
**Why is this change needed?**
- Proper documentation is essential for developers to understand Flutter
widgets efficiently.
- The missing bracket could cause confusion for new contributors and
developers reading the API documentation.
- While this is a small fix, ensuring high-quality documentation aligns
with Flutter’s commitment to a great developer experience.
**Screenshot Before Fixing**
<img width="615" alt="Screenshot 2025-03-25 at 12 08 15 AM"
src="https://github.com/user-attachments/assets/d714d15d-5c78-46cf-8e7e-7347a788f9c7"
/>
**Screenshot After Fixing**
<img width="578" alt="Screenshot 2025-03-25 at 12 20 20 AM"
src="https://github.com/user-attachments/assets/59dce920-1901-4d89-a598-f9e79a07a2d2"
/>
**Joining the Flutter Open-Source Community**
This is my first open-source contribution to Flutter, and I’m very
excited to start contributing more to the project! 🚀
## 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.
- [x] I updated/added relevant documentation (doc comments with ///).
- [x] 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.
This PR introduces a `bool useSystemColors` parameter to the `ThemeData`
constructor.
The goal from this PR is to enable users to easily create high contrast
themes that are based on system colors for their `MaterialApp`:
```dart
MaterialApp(
theme: ThemeData.light(),
darkTheme: ThemeData.dark(),
highContrastTheme: ThemeData(useSystemColors: true, ...),
highContrastDarkTheme: ThemeData(useSystemColors: true, ...),
)
```
The `MaterialApp` widget will automatically pick the correct one of the
4 themes based on system settings (light/dark mode, high contrast
enabled/disabled).
Depends on https://github.com/flutter/flutter/pull/164933
Closes https://github.com/flutter/flutter/issues/118853
Fix: Remove attach target on deactivation of widget from overlay portal
controller
fixes: #164376
## 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.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] 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.
With this change, widgets based on EditableText will show the system
context menu by default on iOS. Anyone with a custom contextMenuBuilder
will not be affected and will have to opt-in to using SystemContextMenu.
Also, this does not affect SelectionArea, which can't receive paste.
Fixes https://github.com/flutter/flutter/issues/163067
This change reworks how users define previews in their code, expands the
number of valid 'functions' that can be used to create previews, and
allows for specifying a 'wrapper' function to wrap the previewed widget
with
The `WidgetPreview` class has been removed from the framework, with its
properties being added to the `Preview` annotation class instead to
remove some boilerplate from the preview declaration workflow.
Before:
```dart
@Preview()
List<WidgetPreview> previews() => <WidgetPreview>[
WidgetPreview(
name: 'Top-level preview',
child: Text('Foo'),
),
];
```
After:
```dart
@Preview(name: 'Top-level preview')
Widget previews() => Text('Foo');
```
Previews can now be defined using top-level functions, constructors and
factories which take no arguments, and static methods within classes:
Examples:
```dart
@Preview(name: 'Top-level preview')
Widget previews() => Text('Foo');
class MyWidget extends StatelessWidget {
@Preview(name: 'Constructor preview')
MyWidget.preview();
@Preview(name: 'Factory preview')
factory MyWidget.factoryPreview() => MyWidget.preview();
@Preview(name: 'Static preview')
static Widget previewStatic() => Text('Static');
@override
Widget build(BuildContext context) {
return Text('MyWidget');
}
}
```
Users can also provide a `wrapper` function with the signature `Widget
Function(Widget)` to easily wrap previewed widget with shared
bootstrapping logic.
Example:
```dart
Widget testWrapper(Widget child) {
return Provider<int>.value(
value: 42,
child: child,
);
}
@Preview(name: 'Preview with wrapper', wrapper: testWrapper)
Widget preview() {
return Text('Attributes');
}
```
Which is effectively the same as:
```dart
@Preview(name: 'Preview with wrapper')
Widget preview() {
return Provider<int>.value(
value: 42,
child: Text('Attributes'),
);
}
```
Finally, for situations where a `BuildContext` is needed, users can
return a `WidgetBuilder` from their preview function:
```dart
@Preview('Builder preview')
WidgetBuilder builderPreview() {
return (BuildContext context) {
// TODO: retrieve state from context.
return Text('Foo');
};
}
```