Commit Graph

41226 Commits

Author SHA1 Message Date
Greg Spencer
d68e05bf36 Reland: Request focus if accessibility focus is given to a Focus widget (#142942) (#149840)
## Description

This attempts to re-land #142942 after being reverted in https://github.com/flutter/flutter/pull/149741 because it broke the iOS [platform view UI integration test](https://github.com/flutter/flutter/blob/master/dev/integration_tests/ios_platform_view_tests/ios/PlatformViewUITests/PlatformViewUITests.m?rgh-link-date=2024-06-06T19%3A47%3A27Z).

The changes here from the original are that in the Focus widget we no longer set the `onFocus` for the `Semantics` if the platform is iOS.  It was not intended to do anything on iOS anyhow.

Also, I updated the matchers to not actually do anything yet with the SemanticsAction.focus matching, so that this can be landed without breaking customer tests, and once they have been updated to correctly look for the focus action, we can land a PR that will turn it on.

## Related Issues
 - https://github.com/flutter/flutter/issues/149838
 - https://github.com/flutter/flutter/issues/83809
 - https://github.com/flutter/flutter/issues/149842

## Tests
 - Updated framework tests to look for the appropriate things using the matchers, even though it doesn't actually test for them yet.
2024-06-12 20:05:10 +00:00
FMorschel
0c692b86ba Update WidgetStatesController docs (#150081)
Just updated the docs that mentioned the old name (`MaterialStatesController`) that now is another class. It was showing in the [docs website](https://api.flutter.dev/flutter/widgets/WidgetStatesController-class.html) with the deprecated line-through style so I noticed it.
2024-06-12 18:41:14 +00:00
Taha Tesser
04dc553e83 [Reland] Fix SegmentedButton clipping when drawing segments (#149739) (#150090)
Relands https://github.com/flutter/flutter/pull/149739 which was reverted due to https://github.com/flutter/flutter/issues/149851

--- 

fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](https://github.com/flutter/flutter/issues/144990)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SegmentedButton<int>(
            segments: const <ButtonSegment<int>>[
              ButtonSegment<int>(
                value: 0,
                label: ColorFiltered(
                  colorFilter:
                      ColorFilter.mode(Colors.amber, BlendMode.colorBurn),
                  child: Text('Option 1'),
                ),
              ),
              ButtonSegment<int>(
                value: 1,
                label: Text('Option 2'),
              ),
            ],
            onSelectionChanged: (Set<int> selected) {},
            selected: const <int>{0},
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before

![before](https://github.com/flutter/flutter/assets/48603081/b402fc51-d575-4208-8a71-f798ef2b2bf5)

### After

![after](https://github.com/flutter/flutter/assets/48603081/77a5cac2-ecef-4381-a043-dbb5c91407ec)

*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*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.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-06-12 18:41:11 +00:00
Nate Wilson
a8f903223b Fix markdown hyperlinks in the style guide (#150071)
Some of the syntax in the migrated [style guide](14df7be3f9/docs/contributing/Style-guide-for-Flutter-repo.md (lazy-programming)) (and "workarounds for common issues") doesn't show up super well as a `.md` file on GitHub. (related: #145009)

<br>

#### Current

> You may hear team members say "embrace the http://www.catb.org/jargon/html/Y/yak-shaving.html[yak
shave]!". This is an encouragement to https://www.youtube.com/watch?v=AbSehcT19u0[take on the larger effort necessary] to perform a proper fix for a problem rather than just applying a band-aid.

#### This PR

> You may hear team members say "embrace the [yak shave](http://www.catb.org/jargon/html/Y/yak-shaving.html)!". This is an encouragement to [take on the larger effort necessary](https://www.youtube.com/watch?v=AbSehcT19u0) to perform a proper fix for a problem rather than just applying a band-aid.

<br>

Workarounds-for-common-issues.md: [**before**](14df7be3f9/docs/wiki_archive/Workarounds-for-common-issues.md) / [**after**](c8d84a71b7/docs/wiki_archive/Workarounds-for-common-issues.md)
2024-06-12 18:41:10 +00:00
Jenn Magder
0d5bf0f548 Update packages desktop PR triage link lables (#150124)
Change links to desktop package PRs to ones with labels specific to the platform.
2024-06-12 18:04:21 +00:00
Victor Sanni
3db2ece735 Add mouse cursor property to CupertinoRadio (#149681)
Adds `mouseCursor` property in `Radio` to `CupertinoRadio` and `Radio.adaptive`.

The `mouseCursor` property added is of type `MouseCursor` and not `WidgetStateProperty<MouseCursor>` to match `Radio`'s `mouseCursor`.
2024-06-12 17:45:07 +00:00
Jackson Gardner
b1f9d7131c Update to Chrome for Testing 125, since we haven't updated in a bit. (#149933)
Chrome version bump. That is all.
2024-06-12 16:36:59 +00:00
engine-flutter-autoroll
2f030975bd Roll Packages from 8c24fd4ec947 to 260102b64c0f (1 revision) (#150115)
8c24fd4ec9...260102b64c

2024-06-11 stuartmorgan@google.com [tool] Provide better CI feedback for combo PRs (flutter/packages#6865)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-06-12 15:52:06 +00:00
stuartmorgan
4afadeae3e Add a doc for the flutter/packages gardener (#149682)
This is intended to replace the currently internal-only document for flutter/packages gardeners. It is a hybrid of the existing document and the Flutter-Framework-Gardener-Rotation.md document (in order to try to improve consistency relative to just moving the existing doc as-is).
2024-06-12 14:57:00 +00:00
Valentin Vignal
9b3c936eb3 Reland "Add tests for scaffold drawer and end drawer" (#150045) (#150047)
This relands commit 14df7be3f9.

Contributes to https://github.com/flutter/flutter/issues/130459

Needs https://github.com/flutter/flutter/issues/149851 to be fixed before getting merged
2024-06-12 14:55:17 +00:00
Bruno Leroux
fdb74fd3e7 Fix DropdownMenu can be focused and updated when disabled (#149737)
## Description

This PRs fixes `DropdownMenu` behaviors when disabled.

Before this PR the `DropdownMenu` value can be changed when `DropdownMenu.enabled` was false because the inner `IconButton` was not disabled so it can get focus (for instance using tab key).

After this PR, the inner `TextField` and the inner `IconButton` are disabled when `DropdownMenu.enabled` is false.

## Related Issue

Fixes https://github.com/flutter/flutter/issues/149598.

## Tests

Updates 1 test.
Adds 1 test.
2024-06-12 08:47:07 +00:00
flutter-pub-roller-bot
ad462e2783 Roll pub packages (#150070)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-12 05:40:31 +00:00
Michael Goderbauer
962ae8a334 Remove double MaterialApp wrap from api samples (#150055)
The widget under test already contains a MaterialApp, so there's no need to wrap it again with one in the test. In fact, the additional MaterialApp could hide problems in the widget under test.
2024-06-12 05:22:23 +00:00
Elliott Brooks
1f93809ad2 Add new WidgetInspector service extension: getRootWidgetTree (#150010)
The new service extension `getRootWidgetTree` can be used instead of the existing:

* `getRootWidgetSummaryTree` -->  use`getRootWidgetTree` with parameters `isSummaryTree=true`
* `getRootWidgetSummaryTreeWithPreviews` --> use `getRootWidgetTree` with parameters `isSummaryTree=true` and `withPreviews=true`

This new service extension will enable Flutter DevTools to combine the widget summary tree with the widget details tree by calling `getRootWidgetTree` with `isSummary=false` and `withPreviews=true`. 

Closes https://github.com/flutter/devtools/issues/7894
2024-06-12 05:15:34 +00:00
Satyam Srivastav
c5e5e0cc36 closes #issue136763, changed a command to generate gradle error message according to platform (#149877)
Currently, the error message displayed to regenerate the lockfiles gives a Unix-like command ./gradlew, which will be incorrect for Windows environments. This PR uses globals.platform.isWindows to give the appropriate command.

closes #136763
2024-06-12 05:12:57 +00:00
engine-flutter-autoroll
cc24f877db Roll Flutter Engine from 1cdbebee1901 to c7fcbfce608f (54 revisions) (#150069)
Roll Flutter Engine from 1cdbebee1901 to c7fcbfce608f (54 revisions)

1cdbebee19...c7fcbfce60

2024-06-11 jason-simmons@users.noreply.github.com Fix character getter API usage in stripLeftSlashes/stripRightSlashes (flutter/engine#53299)
2024-06-11 yjbanov@google.com [web] switch from .didGain/LoseAccessibilityFocus to .focus (flutter/engine#53134)
2024-06-11 skia-flutter-autoroll@skia.org Roll Dart SDK from 282b3347dc3e to ab4d5a0b789d (1 revision) (flutter/engine#53338)
2024-06-11 bdero@google.com [Flutter GPU] Generate DescriptorSetLayouts for pipelines & export symbols on Android. (flutter/engine#53184)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from cd2249d1ba33 to b5f974ec2dcd (4 revisions) (flutter/engine#53337)
2024-06-11 jonahwilliams@google.com [Impeller] remove varying interpolation for solid colors. (flutter/engine#53281)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from 67c3ee616fb5 to cd2249d1ba33 (4 revisions) (flutter/engine#53335)
2024-06-11 jonahwilliams@google.com [engine] null check texture registry in OnPlatformViewMarkTextureFrameAvailable. (flutter/engine#53334)
2024-06-11 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 66ed61abe85e to 282b3347dc3e (4 revisions) (flutter/engine#53332)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from 74061baa5402 to 67c3ee616fb5 (2 revisions) (flutter/engine#53333)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from f4d3467f2742 to 74061baa5402 (1 revision) (flutter/engine#53331)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from 5afbe0a7aded to f4d3467f2742 (1 revision) (flutter/engine#53330)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from eb8a53033e88 to 5afbe0a7aded (1 revision) (flutter/engine#53328)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from ed92d84ffd3a to eb8a53033e88 (1 revision) (flutter/engine#53327)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from 6e7a7a72cf3e to ed92d84ffd3a (5 revisions) (flutter/engine#53326)
2024-06-11 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 3.25.6 to 3.25.8 (flutter/engine#53325)
2024-06-11 49699333+dependabot[bot]@users.noreply.github.com Bump google/osv-scanner-action from 1.7.3 to 1.7.4 (flutter/engine#53324)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from b2bc3608f5c7 to 6e7a7a72cf3e (1 revision) (flutter/engine#53323)
2024-06-11 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 235dc289e4bf to 66ed61abe85e (5 revisions) (flutter/engine#53319)
2024-06-11 skia-flutter-autoroll@skia.org Roll Skia from 38733e27e0d2 to b2bc3608f5c7 (1 revision) (flutter/engine#53321)
2024-06-10 15619084+vashworth@users.noreply.github.com Temporarily run Linux linux_web_engine Mac tests on Mac-13 only (flutter/engine#53318)
2024-06-10 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from -oOBf1l63tk7CztFd... to LS0Ff8PwQEGXzO0iA... (flutter/engine#53317)
2024-06-10 smartercallum@gmail.com Map mouse pointer type on Linux (flutter/engine#52418)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 09cebc502599 to 38733e27e0d2 (1 revision) (flutter/engine#53316)
2024-06-10 15619084+vashworth@users.noreply.github.com Temporarily run Mac mac_host_engine on only Mac-13  (flutter/engine#53313)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 178953621308 to 09cebc502599 (1 revision) (flutter/engine#53312)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 009d184e82c5 to 178953621308 (2 revisions) (flutter/engine#53311)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 163df01252cd to 009d184e82c5 (1 revision) (flutter/engine#53309)
2024-06-10 kustermann@google.com Use dart.library.html to distinguish dart2wasm from dart2js/ddc in conditional imports (flutter/engine#53307)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 74b1e88878e1 to 163df01252cd (1 revision) (flutter/engine#53308)
2024-06-10 kustermann@google.com Use new dart:js_interop way to externalize/internalize objects (flutter/engine#53304)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 09e5ddcd4d23 to 74b1e88878e1 (1 revision) (flutter/engine#53305)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from e22a628e1ee0 to 09e5ddcd4d23 (1 revision) (flutter/engine#53302)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from 70d479753d41 to e22a628e1ee0 (2 revisions) (flutter/engine#53301)
2024-06-10 skia-flutter-autoroll@skia.org Roll Skia from aafc81dcd88d to 70d479753d41 (1 revision) (flutter/engine#53300)
2024-06-09 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 8-r8iw3r4h35XQ4GP... to -oOBf1l63tk7CztFd... (flutter/engine#53298)
2024-06-09 skia-flutter-autoroll@skia.org Roll Skia from 7d410bf13546 to aafc81dcd88d (1 revision) (flutter/engine#53297)
2024-06-08 bdero@google.com [Impeller] Move SeparatedVector2 to impeller/geometry. (flutter/engine#53264)
2024-06-08 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from zpBZmUB_JC5AjG-f4... to 8-r8iw3r4h35XQ4GP... (flutter/engine#53291)
2024-06-08 skia-flutter-autoroll@skia.org Roll Skia from a6c905943fe6 to 7d410bf13546 (1 revision) (flutter/engine#53290)
2024-06-08 skia-flutter-autoroll@skia.org Roll Dart SDK from 48c6249a5b97 to 235dc289e4bf (1 revision) (flutter/engine#53289)
2024-06-08 skia-flutter-autoroll@skia.org Roll Skia from ad3c9f203f4e to a6c905943fe6 (1 revision) (flutter/engine#53288)
2024-06-08 skia-flutter-autoroll@skia.org Roll Dart SDK from d4f17e0bf28b to 48c6249a5b97 (1 revision) (flutter/engine#53287)
2024-06-08 30870216+gaaclarke@users.noreply.github.com [impeller] switches gaussian blur to a "source space" calculation (flutter/engine#53261)
2024-06-07 yjbanov@google.com [web] add test for inefficient overlay allocation (flutter/engine#53284)
2024-06-07 jacksongardner@google.com Update Chrome to 125. (flutter/engine#53282)
...
2024-06-12 05:11:07 +00:00
engine-flutter-autoroll
9983cedd7c Roll Packages from e95fe4a0cd3a to 8c24fd4ec947 (7 revisions) (#150051)
e95fe4a0cd...8c24fd4ec9

2024-06-11 engine-flutter-autoroll@skia.org Roll Flutter from 32081aab69 to 14df7be3f9 (21 revisions) (flutter/packages#6907)
2024-06-11 luthien256@gmail.com Ensure each code block specified in the markdown uses its own ScrollController. (flutter/packages#6904)
2024-06-10 stuartmorgan@google.com [video_player] Try to address test flake (flutter/packages#6899)
2024-06-10 stuartmorgan@google.com [ci] Allow `platform` references (flutter/packages#6903)
2024-06-10 magder@google.com Change CODEOWNERS for metrics_center (flutter/packages#6892)
2024-06-10 mit@google.com Remove package:platform source (flutter/packages#6898)
2024-06-10 engine-flutter-autoroll@skia.org Roll Flutter from fc19ecfc58 to 32081aab69 (9 revisions) (flutter/packages#6896)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-06-12 05:09:16 +00:00
Greg Spencer
966d2b9223 Fix ColorScheme example and tests (#150018)
## Description

This fixes the `ColorScheme` example to actually work.  The test had wrapped the app in an additional `MaterialApp`, which allowed the tests to work, but the real problem was using a `context` that was outside the `MaterialApp` to open the bottom sheet, which caused an exception when you actually try to run it interactively.

This fixes the example and the test.

## Tests
 - Fixed the test to not artificially add a second `MaterialApp`.
2024-06-12 05:07:23 +00:00
yaakovschectman
14df7be3f9 Revert "Add tests for scaffold drawer and end drawer" (#150045)
Reverts flutter/flutter#149383 as it caused failure for mac
framework_tests_impeller.
2024-06-11 11:14:54 -04:00
Valentin Vignal
aad70e5cdb Add tests for scaffold drawer and end drawer (#149383)
Contributes to https://github.com/flutter/flutter/issues/130459

It adds a test for
- `examples/api/lib/material/scaffold/scaffold.drawer.0.dart`
- `examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart`
2024-06-11 07:06:24 +00:00
Qun Cheng
f05095e0b7 Add high-contrast theme (#149779)
This is to add a high-contrast color scheme when we turn on high-contrast mode. Fixes https://github.com/flutter/flutter/issues/149683
2024-06-11 00:31:08 +00:00
Michael Goderbauer
1b8d083ab6 Manual Pub Roll (#150025)
Supersedes https://github.com/flutter/flutter/pull/149908
2024-06-11 00:02:26 +00:00
Chris Bracken
95ba272c9c [docs] Per-platform desktop triage instructions (#150019)
`team-desktop` has been split into `team-linux`, `team-macos`, and `team-windows`. This updates the triage instructions to cover those platforms.
2024-06-10 23:28:17 +00:00
Greg Price
56cd396433 Fix copy-paste-o in MethodChannel.invokeListMethod doc (#149976)
This sentence didn't make a lot of sense as written.  It looks like
it was probably based on the doc of invokeMapMethod, and then
incompletely adapted.  So, fix it.
2024-06-10 22:43:55 +00:00
Gray Mackall
b889e3a6f7 Unpin camera_android and remove its only usage (#150017)
Fixes https://github.com/flutter/flutter/issues/146004

The `camera_android`plugin had its version pinned when it was still used in the `gradle_deprecated_settings`. It has since been [replaced](https://github.com/flutter/flutter/pull/148426) by `camera_android_camerax`, and therefore isn't used in `flutter/flutter`. So it's pin should be fine to remove.
2024-06-10 22:13:00 +00:00
chunhtai
7755edd0d1 Fixes a bug where NavigatorState.pop does not consider any possible s… (#150014)
…tate of the popped route

fixes https://github.com/flutter/flutter/issues/146938
2024-06-10 22:11:36 +00:00
auto-submit[bot]
5eaeacab3f Reverts "Reland: [CupertinoActionSheet] Match colors to native (#149568) (#150015)" (#150021)
Reverts: flutter/flutter#150015
Initiated by: vashworth
Reason for reverting: Still failing tree on goldens
Original PR Author: dkwingsmt

Reviewed By: {chunhtai}

This change reverts the following previous change:
Relands #149568, which was reverted in https://github.com/flutter/flutter/pull/149998 due to unverified golden tests post-commit. (Honestly I don't know what happened but I guess resubmitting should resolve it.)

No code is changed.
2024-06-10 21:20:28 +00:00
Tong Mu
52df034477 Reland: [CupertinoActionSheet] Match colors to native (#149568) (#150015)
Relands #149568, which was reverted in
https://github.com/flutter/flutter/pull/149998 due to unverified golden
tests post-commit. (Honestly I don't know what happened but I guess
resubmitting should resolve it.)

No code is changed.

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] 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].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-06-10 13:17:31 -07:00
Victoria Ashworth
fa30ecff8a Temporarily run Mac_arm64 framework_tests_misc on only Mac-13 (#150009)
Temporary solution for https://github.com/flutter/flutter/issues/150008.
2024-06-10 20:07:03 +00:00
chunhtai
bc0134d3d6 Fixes TextField hinttext in a11y_assessment (#150007)
b/317131589
2024-06-10 19:58:58 +00:00
Martin Kustermann
c0b2645b8a Use const bool.fromEnvironment("dart.tool.dart2wasm") to detect dart2wasm (#149996)
Dart2Wasm doesn't officially support `dart:ffi` (only a small sketchy
subset needed in flutter web engine). We have seen user reporting issues
where existing packages don't work with dart2wasm due to using
`dart.library.ffi` in `bool.fromEnvironment` or in conditional imports
and it doing the wrong thing. So we're going to make `dart.library.ffi`
`false` in the compiler.

We therefore update the code to detect whether it runs under wasm via a
new `dart.tool.dart2wasm` environment variable.

This is a preparation for the change in dart2wasm which will start
making `const bool.fromEnvironment('dart.library.ffi')` return `false`
instead of `true`.
2024-06-10 21:56:18 +02:00
engine-flutter-autoroll
03b487b246 Roll Packages from 8a2c4e499973 to e95fe4a0cd3a (3 revisions) (#149997)
8a2c4e4999...e95fe4a0cd

2024-06-07 engine-flutter-autoroll@skia.org Manual roll Flutter from 4608a89137 to fc19ecfc58 (38 revisions) (flutter/packages#6890)
2024-06-07 stuartmorgan@google.com [pigeon] Fix handling of null class args in C++ (flutter/packages#6881)
2024-06-07 eugene.makar@yandex.ru [video_player_android] Migrate ExoPlayer to ExoPlayer-Media3 1.3.1 (flutter/packages#6535)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-06-10 19:32:39 +00:00
David Iglesias
0c2ee845fc [web] Notify engine of handled PointerScrollEvents. (#145500)
Notifies the engine when `PointerSignalEvents` have been ignored by the framework, through the `ui.PointerData.respond` method.

This allows the web to "preventDefault" (or not) on `wheel` events.

## Issues

* Fixes (partially): https://github.com/flutter/flutter/issues/139263

## Tests

* Added tests to ensure `respond` is called at the right time, with the right value.

## Demo

* https://dit-multiview-scroll.web.app

<details>
<summary>

## Previous versions

</summary>

1. Modified `PointerScrollEvent`, not shippable.
2. Modified when events were handled, instead of the opposite.

</details>
2024-06-10 17:52:58 +00:00
Greg Price
5efb67b7c1 Cut no-longer-accurate microtask reference in finalizeTree doc (#149941)
These listeners were removed in b564b4cca (#9143).
2024-06-10 17:13:30 +00:00
Takahiro Torii
739e3bd0e8 Update hasTrailingSpaces (#149698)
This PR addresses an issue with TextPainter's caret position calculation for text containing full-width spaces. Currently, the caret position is not accurately calculated for strings with full-width spaces. To resolve this, the following changes have been made:

Corrected the logic for caret position calculation when full-width spaces are present in the text.
Added and updated test cases to ensure accurate caret position calculation.
These changes ensure that the caret position for text with full-width spaces is computed correctly.

This issue was introduced by the commit [a0a854a](a0a854a78b).

Related Issue: [#149099](https://github.com/flutter/flutter/issues/149099)
2024-06-10 16:48:11 +00:00
Mouad Debbar
ee10d2fc3a [web] Change --web-renderer default from auto to canvaskit (#149773)
- When `--web-renderer` is omitted, keep the value `null` until it later materializes to either `canvaskit` or `skwasm`.
- No more hardcoded defaults anywhere. We use `WebRendererMode.defaultForJs/defaultForWasm` instead.
- When in `--wasm` mode, the JS fallback is now `canvaskit` instead of `auto`.
- Add test for defaulting to `skwasm` when `--wasm` is enabled.

Fixes https://github.com/flutter/flutter/issues/149826
2024-06-10 16:38:09 +00:00
Jason Simmons
4e6e61dfd5 Retain the toString method for subclasses of Key in profile/release mode (#149926)
toString methods are removed in AOT builds by the optimization in https://github.com/flutter/flutter/pull/144763

This PR disables that for Key subclasses because some applications rely on the previous behavior.

Fixes https://github.com/flutter/flutter/issues/148983
2024-06-10 16:06:02 +00:00
Michael Thomsen
2d0a0237d2 Remove package:platform from issue template (#149995)
Package is being transferred to the `dart-lang` github org: https://github.com/flutter/flutter/issues/141808
2024-06-10 16:03:12 +00:00
Victoria Ashworth
8b6be37c1a Revert "[CupertinoActionSheet] Match colors to native (#149568)" (#149998)
This reverts commit 32081aab69.

Reason for revert: Appears to be failing tests in tree
```
01:48 +2991 ~18: /Volumes/Work/s/w/ir/x/w/flutter/packages/flutter/test/cupertino/action_sheet_test.dart: Taps on a button can be slided to other buttons
 ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
 The following SkiaException was thrown while running async test code:
 Skia Gold received an unapproved image in post-submit
 testing. Golden file images in flutter/flutter are triaged
 in pre-submit during code review for the given PR.
 Visit https://flutter-gold.skia.org/ to view and approve
 the image(s), or revert the associated change. For more
 information, visit the wiki:
 https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter
 Debug information for Gold --------------------------------
 stdout: Given image with hash 601f421e3bb643f437cc12395de96152 for test
 cupertino.cupertinoActionSheet.press-drag
 Expectation for test: ce8ef79c146857d162663b1161fd6d5c (positive)
 Expectation for test: 3bb57a8782f67836c6ad3ece7f00729a (positive)
 Expectation for test: 3f8c592774caf3c760fbbd318a7dc5af (positive)
 Expectation for test: 61863f38217aa3349c239eeb49b84930 (positive)
 Expectation for test: 98af16e9b7eb3fb810b44c74bb18ffb9 (positive)
 Untriaged or negative image:
 https://flutter-gold.skia.org//detail?grouping=name%3Dcupertino.cupertinoActionSheet.press-drag%26source_type%3Dflutter&digest=601f421e3bb643f437cc12395de96152
 stderr: Test: cupertino.cupertinoActionSheet.press-drag FAIL
 result-state.json: No result file found.
 ```
2024-06-10 15:40:56 +00:00
Tong Mu
32081aab69 [CupertinoActionSheet] Match colors to native (#149568)
This PR matches the various colors of `CupertinoActionSheet` more closely with the native one. 

The following colors are changed.
* Sheet background color
* Pressed button color
* Cancel button color
* Pressed cancel button color
* Divider color
* Content text color

The resulting colors match with native one with deviation of at most 1 (in terms of 0~255 RGB).

The following are comparison (left to right: Native, Flutter after PR, Flutter current)
<img width="1295" alt="image" src="https://github.com/flutter/flutter/assets/1596656/3703a4a8-a856-42b1-9395-a6e14b1881ca">
<img width="1268" alt="image" src="https://github.com/flutter/flutter/assets/1596656/1eb9964e-41f1-414a-99ae-0a2e7da8d3fd">
_Note: The divider thickness is adjusted to `1/dpr` instead of 0.3 in both Flutter version to make them look more native, as will be proposed in https://github.com/flutter/flutter/pull/149636._

### Derivation 
All the colors are derived through color picker and calculation. The algorithm is as followed:
* Assume all colors are translucent grey colors, i.e. having the same value `x` for R, G, and B, with an alpha `a`.
* Given the barrier color is `x_B1=0` when the background is black, and `x_B2=204` when the background is white.
* Pick the target color `x_t1` when the background is black, and `x_t2` when the background is white
* Solve the following equations for `x` and `a`
```
a * x + (1-a) * x_B1 = x_t1
a * x + (1-a) * x_B2 = x_t2

a = 1 - (x_t1 - x_t2) / (x_B1 - x_B2)
x = (x_t1 - (1-a) * x_B1) / a
```

These equations use a linear model for color composition, which might not be exact, but is close enough for an accuracy of (1/255).

The full table is as follows:

<img width="1091" alt="image" src="https://github.com/flutter/flutter/assets/1596656/0fb76291-c3cc-4bb5-aefa-03ac6ac9bf1f">

* The first two columns are colors picked from XCode.
* The 3~4 columns are the colors picked from the current Flutter. Notice the deviation, which is sometimes drastic.
* The 5~6 columns are the colors picked from Flutter after this PR. The deviation is at most 1.
* The last few columns are calculation.
  * There are two rows whose calculation is based on adjusted numbers, since the original results are not accurate enough, possibly due to the linear composition.

During the calculation, I assumed these colors vary between light and dark modes, but it turns out that both modes use the same set of colors.

### Screenshots
2024-06-08 17:35:21 +00:00
auto-submit[bot]
f3808422a7 Reverts "Roll Flutter Engine from 1cdbebee1901 to 45cf05f7a580 (10 revisions) (#149944)" (#149960)
Reverts: flutter/flutter#149944
Initiated by: jason-simmons
Reason for reverting: Regression affecting `integration_test/test/web_extension_test.dart`

```
  PathNotFoundException: Cannot open file, path = '/chromium/canvaskit.wasm' (OS Error: No such file or directory, errno = 2)
```

(see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8745735238400976001/+/u/run_test.dart_for_web_long_running_tests_shard_and_subshard_1_5/stdout)

It looks like the p
Original PR Author: engine-flutter-autoroll

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:

1cdbebee19...45cf05f7a5

2024-06-07 yjbanov@google.com [web] add test for inefficient overlay allocation (flutter/engine#53284)
2024-06-07 jacksongardner@google.com Update Chrome to 125. (flutter/engine#53282)
2024-06-07 skia-flutter-autoroll@skia.org Roll Dart SDK from 4b693b16eec1 to d4f17e0bf28b (1 revision) (flutter/engine#53283)
2024-06-07 jacksongardner@google.com Fixes a few issues in flutter_js (flutter/engine#53231)
2024-06-07 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from aVohW_hnfDaE0smBX... to zpBZmUB_JC5AjG-f4... (flutter/engine#53279)
2024-06-07 skia-flutter-autoroll@skia.org Roll Dart SDK from 7b239d7f4578 to 4b693b16eec1 (1 revision) (flutter/engine#53277)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from b7f51dfcc342 to ad3c9f203f4e (1 revision) (flutter/engine#53276)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from 5fc83884a619 to b7f51dfcc342 (4 revisions) (flutter/engine#53275)
2024-06-07 jonahwilliams@google.com Revert "Widen CPU affinity set." (flutter/engine#53274)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from e36110f8b451 to 5fc83884a619 (1 revision) (flutter/engine#53273)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from aVohW_hnfDaE to zpBZmUB_JC5A

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC matanl@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-06-08 17:05:25 +00:00
engine-flutter-autoroll
f634098b3e Roll Flutter Engine from 1cdbebee1901 to 45cf05f7a580 (10 revisions) (#149944)
1cdbebee19...45cf05f7a5

2024-06-07 yjbanov@google.com [web] add test for inefficient overlay allocation (flutter/engine#53284)
2024-06-07 jacksongardner@google.com Update Chrome to 125. (flutter/engine#53282)
2024-06-07 skia-flutter-autoroll@skia.org Roll Dart SDK from 4b693b16eec1 to d4f17e0bf28b (1 revision) (flutter/engine#53283)
2024-06-07 jacksongardner@google.com Fixes a few issues in flutter_js (flutter/engine#53231)
2024-06-07 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from aVohW_hnfDaE0smBX... to zpBZmUB_JC5AjG-f4... (flutter/engine#53279)
2024-06-07 skia-flutter-autoroll@skia.org Roll Dart SDK from 7b239d7f4578 to 4b693b16eec1 (1 revision) (flutter/engine#53277)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from b7f51dfcc342 to ad3c9f203f4e (1 revision) (flutter/engine#53276)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from 5fc83884a619 to b7f51dfcc342 (4 revisions) (flutter/engine#53275)
2024-06-07 jonahwilliams@google.com Revert "Widen CPU affinity set." (flutter/engine#53274)
2024-06-07 skia-flutter-autoroll@skia.org Roll Skia from e36110f8b451 to 5fc83884a619 (1 revision) (flutter/engine#53273)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from aVohW_hnfDaE to zpBZmUB_JC5A

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC matanl@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-06-08 01:49:29 +00:00
Elliott Brooks
034c0d03f8 Refactor getRootWidgetSummaryTree tests in widget_inspector_test.dart (#149930) 2024-06-07 16:51:47 -07:00
Zachary Anderson
47560fac5c Remove zanderso from TESTOWNERS (#149935)
Instead I've added @andrewkolos for tools tests and @jtmcdole for engine
tests. This doesn't mean you have to investigate and solve the issues
filed by the flake bot. Instead, an assignee is just the mechanism used
by the flake bot to ensure that the issues are triaged at the
appropriate team triage meetings.

FYI @christopherfujino
2024-06-07 16:33:46 -07:00
Hans Muller
9ce0a9e510 PinnedHeaderSliver (#143196)
A sliver that remains “pinned” to the top of the scroll view. Subsequent slivers scroll behind it. Typically the sliver is created as the first item in the list however it can be inserted anywhere and it will always stop at the top of the scroll view. When the scrolling axis is vertical, the PinnedHeaderSliver’s height is defined by its widget child. Multiple PinnedHeaderSlivers will layout one after the other, once they've scrolled to the top.

This sliver is preferable to the general purpose SliverPersistentHeader - for its relatively narrow use case - because there's no need to create a [SliverPersistentHeaderDelegate] or to predict the header's size.

Here's a [working demo in DartPad](https://dartpad.dev/?id=3b3f24c14fa201f752407a21ca9c9456).

https://github.com/flutter/flutter/assets/1377460/943f2e02-8e73-48b7-90be-61168978ff71

Related sliver utility PRs: https://github.com/flutter/flutter/pull/143538, https://github.com/flutter/flutter/pull/143325, https://github.com/flutter/flutter/pull/127340.
2024-06-07 21:27:06 +00:00
Elliott Brooks
6bdebcf58d Fix test case in "getRootWidgetSummaryTree" test (#149923) 2024-06-07 13:20:25 -07:00
Gray Mackall
15307a9c57 Revert "Identify and re-throw our dependency checking errors in flutter.groovy (#149609)" (#149918)
This reverts commit 9d1de7b674.

Reverts due to log spam and crashing of the dependency version checker (which doesn't block the build but still isn't the desired outcome).
2024-06-07 20:07:06 +00:00
auto-submit[bot]
b5697a0c6d Reverts "Fix SegmentedButton clipping when drawing segments (#149739)" (#149927)
Reverts: flutter/flutter#149739
Initiated by: QuncCccccc
Reason for reverting: the newly-added unit test might cause the red tree
Original PR Author: TahaTesser

Reviewed By: {QuncCccccc}

This change reverts the following previous change:
fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](https://github.com/flutter/flutter/issues/144990)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SegmentedButton<int>(
            segments: const <ButtonSegment<int>>[
              ButtonSegment<int>(
                value: 0,
                label: ColorFiltered(
                  colorFilter:
                      ColorFilter.mode(Colors.amber, BlendMode.colorBurn),
                  child: Text('Option 1'),
                ),
              ),
              ButtonSegment<int>(
                value: 1,
                label: Text('Option 2'),
              ),
            ],
            onSelectionChanged: (Set<int> selected) {},
            selected: const <int>{0},
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before

![before](https://github.com/flutter/flutter/assets/48603081/b402fc51-d575-4208-8a71-f798ef2b2bf5)

### After

![after](https://github.com/flutter/flutter/assets/48603081/77a5cac2-ecef-4381-a043-dbb5c91407ec)
2024-06-07 19:30:18 +00:00
Taha Tesser
fc19ecfc58 Fix SegmentedButton clipping when drawing segments (#149739)
fixes [`SegmentedButton` doesn't clip properly when one of the segments has `ColorFiltered`](https://github.com/flutter/flutter/issues/144990)

### Code sample

<details>
<summary>expand to view the code sample</summary> 

```dart
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: SegmentedButton<int>(
            segments: const <ButtonSegment<int>>[
              ButtonSegment<int>(
                value: 0,
                label: ColorFiltered(
                  colorFilter:
                      ColorFilter.mode(Colors.amber, BlendMode.colorBurn),
                  child: Text('Option 1'),
                ),
              ),
              ButtonSegment<int>(
                value: 1,
                label: Text('Option 2'),
              ),
            ],
            onSelectionChanged: (Set<int> selected) {},
            selected: const <int>{0},
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before

![before](https://github.com/flutter/flutter/assets/48603081/b402fc51-d575-4208-8a71-f798ef2b2bf5)

### After

![after](https://github.com/flutter/flutter/assets/48603081/77a5cac2-ecef-4381-a043-dbb5c91407ec)
2024-06-07 18:34:24 +00:00
Zachary Anderson
bb831b7a64 Shift consistently passing tests on mokey to prod (#149902)
Part of https://github.com/flutter/flutter/issues/148085
2024-06-07 16:48:11 +00:00