This is part 17 of a broken down version of the #140101 refactor (though this particular dependency didn't actually exist back then).
This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.
I also snuck in a minor stylistic change, using interpolation instead of explicit `toString`, to make the code more idiomatic. (I'm actually surprised that that didn't trigger a lint, I thought we had a lint to catch that. I must be thinking of something else though.)
This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
Fixes#138621
Fixes and issue where if a Material widget is used in a Cupertino App, then some parts of it's default Material 3 theming would show up as purplish. This could be fixed by wrapping your app with a Material theme, but that's a little awkward.
Material and Cupertino themes interact with each other a little oddly. If a theme of either is searched for but does not exist, then a default one is generated. So if a Material widget is in a Cupertino app that does not already have a Material theme, then a fallback Material theme will be created. This PR makes it so that, in this case when that Material theme is created, it's default colors will be based on the Cupertino theme.
Another oddity is that a Material theme always wraps itself with a Cupertino theme that's values are based on the Material theme. So before this change, a Material widget would theoretically add a new Material based Cupertino theme to the tree. So I added logic that would have the Material theme check to see if a Cupertino theme exists, before it overwrites it.
Before:

After:
<img width="386" alt="Screenshot 2023-11-29 at 10 37 09â¯AM" src="https://github.com/flutter/flutter/assets/58190796/959ccfd9-3439-438e-ad36-20597334837a">
Update:
I changed it to not rely on the Material 3 flag. Instead, if a Material theme is searched for and there is already a Cupertino theme in the tree, then it will use that Cupertino theme instead of generating a new. Also, if a Material theme is searched for, and it does not find one already in the tree, but does find a Cupertino theme, then it will generate one with a color palette based off of that Cupertino theme's colors.
After with this change:
<img width="390" alt="Screenshot 2024-05-09 at 10 16 22â¯AM" src="https://github.com/flutter/flutter/assets/58190796/79765d04-a7a3-4eb5-9477-11668ed138e5">
We should still probably suggest for developers to include a Material theme in their Cupertino app if they wish to use widgets from both packages.
*This PR changes the date picker were add locale in DatePickerThemeData*
*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
Fixes#148202
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
Reverts: flutter/flutter#147856
Initiated by: loic-sharma
Reason for reverting: tree is closed with errors like:
```
test/integration.shard/break_on_framework_exceptions_test.dart: breaks when rebuilding dirty elements throws [E]
Expected: <45>
Actual: <2756>
package:matcher expect
test\integration.shard\break_on_framework_exceptions_test.dart 56:5 main.expectException
===== asynchronous gap ===
Original PR Author: LongCatIsLooong
Reviewed By: {goderbauer}
This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes.
This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less.
Caveats:
`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.
Tests:
Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
These tests essentially count the number of values in the engine enums. https://github.com/flutter/engine/pull/53094 is adding a new value, which causes these tests to fail. Temporarily disabling these tests so that the engine change can proceed.
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes.
This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less.
Caveats:
`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.
Tests:
Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
Since we are using The `CupertinoScrollBar` for both macOS and iOS, it's a good idea to update the description of the `adaptive` function to indicate it will be used for macOS and iOS
*Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS.*

According to previous discussion at https://github.com/flutter/flutter/pull/145389#discussion_r1561564845, this change makes `_ModalScopeStatus` an `InheritedModel` rather than an `InheritedWidget`, and provides the following methods.
- `isCurrentOf`
- `canPopOf`
- `settingsOf`
For example, `ModalRoute.of(context)!.settings` could become `ModalRoute.settingsOf(context)` as a performance optimization.
Fixes: https://github.com/flutter/flutter/issues/58765
The rationale for the choice of the sentinel value: https://github.com/flutter/engine/pull/52940
The exact value of `kTextHeightNone` should be kept as an implementation detail. It's unfortunate that the current value `0` is dangerously close to `TextStyle.height`'s valid domain. If we ever allow `TextStyle.height == 0` (which totally makes sense) then it shouldn't be difficult to change the const.
The PR changes the default value of hitTestBehavior in snack bars to `HitTestBehavior.deferToChild` when snackBarTheme.insetPadding is not null, so that widgets behind snack bars affected by the value set to insetPadding, remain interactive even while a snack bar is visible. This PR can be considered as an extension to what have been done in PR #127959 which fixes the same problem but for individual snack bars with margin not being null. This PR works on the theme level.
*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
#148566
Reverts: flutter/flutter#148470
Initiated by: eyebrowsoffire
Reason for reverting: Unit test failures closing the tree.
Original PR Author: hello-coder-xu
Reviewed By: {QuncCccccc, Piinks}
This change reverts the following previous change:
* sliverGridDelegate mainAxisExtent add assert,Avoid incorrect use *
Fixes https://github.com/flutter/flutter/issues/138871
It's now possible to override the default selection overlay with CupertinoDatePicker.selectionOverlayBuilder and CupertinoTimerPicker.selectionOverlayBuilder.
Dart2wasm only needs a platform file, which contains the compiled
`dart:*` libraries. There's no need to specify a seperate `--dart-sdk`
option (anymore).
(See also https://dart-review.googlesource.com/c/sdk/+/366821)
## Description
This PRs fixes a Web issue on Linux related to numpad keys.
In https://github.com/flutter/flutter/pull/145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.
When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not `EditableText` (see https://github.com/flutter/flutter/pull/103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the `DoNothingAndStopPropagationTextIntent` intent.
## Related Issue
Fixes https://github.com/flutter/flutter/issues/148447.
## Tests
Updates 2 tests.
Adds 2 tests.
- Fixes a child not removed from `_keepAliveBucket` when widget is no longer kept alive offscreen. Bug was triggering assert in performLayout.
- Adds test to cover the case from bug report
Fixes#138977
It looks like removing `kIsWeb` from the `FocusManager._appLifecycleListener` platform check is causing [memory leaks](https://github.com/flutter/flutter/issues/148985) and test failures.
This pull request fixes#148475 and prevents the test failures shown in #148978.
This is part 16 of a broken down version of the #140101 refactor.
This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.
This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
Both iOS and Android run into issues when the FocusManager starts responding to app lifecycle changes.
Fortunately, this feature is primarily meant for desktop platforms, so the problem can be resolved with a platform check.
fixes https://github.com/flutter/flutter/issues/148475