Commit Graph

23387 Commits

Author SHA1 Message Date
Ian Hickson
961c5b7d93
Remove some vestigial /*!*/ comments (#149361) 2024-06-06 23:34:00 +00:00
Jackson Gardner
5fb34b719e
Attempt to fix some web test flakiness. (#149828)
If the service is disposed when we make calls on it, we need to bubble up an exception that is understood by the callers.

This is another speculative fix for https://github.com/flutter/flutter/issues/149238.
2024-06-06 23:22:51 +00:00
Kate Lovett
01d1e74af5
Remove abi key permanently from golden file testing (#149858)
We have fiddled with this a bunch, and there is definitively no way to reliably include this, so I am removing it.

Since CI does not cover all possible values, we can't consistently look up images for local testing. We thought removing it from the look up would work fine, and it did for most tests, but there were still some that could not find an image without it.

A brief history on the abi key
- added in https://github.com/flutter/flutter/pull/143621
- disabled in https://github.com/flutter/flutter/pull/148023
- added back in https://github.com/flutter/flutter/pull/148072
  - we thought there was only an issue with alphabetizing keys
- removed from local image look up in https://github.com/flutter/flutter/pull/149696

I updated the docs page to also discuss what makes a good key and what does not based on what we learned here.
2024-06-06 23:05:52 +00:00
Tong Mu
87f68a8876
[CupertinoActionSheet] Add sliding tap gesture (#149471)
This PR implements the `CupertinoActionSheet` part of https://github.com/flutter/flutter/issues/19786. 

This PR creates a new kind of gesture "sliding tap", which can be a simple tap but also allows the user to slide to other buttons during the tap, and select the button that the slide ends in.

The following video shows the behavior on a button list (left to right: Native iOS, after PR, before PR):

https://github.com/flutter/flutter/assets/1596656/1718630d-6890-4833-908b-762332a39568

Notice:
1. When the tap starts on a button or on the content section, the gesture can slide into a button to highlight it or activate it.
2. When the user performs a quick tap on a button, the button is immediately highlighted. (Before the PR, the highlight waits until the time out of a tap gesture, causing a quick tap to not highlight anything at all.)

The following video shows the behavior when the actions section scrolls (left to right: Native iOS, after PR)

https://github.com/flutter/flutter/assets/1596656/5eb70bc1-ec25-4376-9500-2aaa12f0034b

Notice:
1. Moving left or right doesn't cancel sliding tap, but moving vertically prioritizes the scrolling.
2. Moving before the drag starts is also recognized as a sliding tap.

Also, multiple pointers interact with the button list following an algorithm of "using earliest pointer". I can't record videos about it but I've added unit tests.
2024-06-06 22:41:05 +00:00
flutter-pub-roller-bot
27972ebb48
Roll pub packages (#149852)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-06 22:35:15 +00:00
Hans Muller
7e3e30929a
SliverResizingHeader (#143325)
A sliver that is pinned to the start of its `CustomScrollView` and reacts to scrolling by resizing between the intrinsic sizes of its min and max extent prototypes.

The minimum and maximum sizes of this sliver are defined by `minExtentPrototype` and `maxExtentPrototype`, a pair of widgets that are laid out once. You can use `SizedBox` widgets to define the size limits.

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 minimum or maximum size.

The sample shows how this sliver's two extent prototype properties can be used to create a resizing header whose minimum and maximum sizes match small and large configurations of the same header widget.

https://github.com/flutter/flutter/assets/1377460/fa7ced98-9d92-4d13-b093-50392118c213

Related sliver utility PRs: https://github.com/flutter/flutter/pull/143538, https://github.com/flutter/flutter/pull/143196, https://github.com/flutter/flutter/pull/127340.
2024-06-06 22:35:12 +00:00
Polina Cherkasova
440b1c64aa
Fix leaky test. (#149823)
Introduced by https://github.com/flutter/flutter/pull/148094
2024-06-06 21:41:22 +00:00
victorgalo
7d525ea318
Add support for setting the heading level for web semantics (#97894) (#125771)
This change adds a new property in Semantics widget that would take an integer corresponding to the heading levels defined by the ARIA heading role. This is necessary in order to get proper accessibility and usability in a website for users who rely on screen readers and other assistive technologies.

Issue fixed by this PR:
fixes https://github.com/flutter/flutter/issues/97894

Engine part:
https://github.com/flutter/engine/pull/41435
2024-06-06 21:24:26 +00:00
auto-submit[bot]
6f2d0be6b5
Reverts "Introduce ChipAnimationStyle to override default chips animations durations (#149245)" (#149847)
Reverts: flutter/flutter#149245
Initiated by: QuncCccccc
Reason for reverting: the newly-added unit test might cause the red tree
Original PR Author: TahaTesser

Reviewed By: {bleroux, Piinks}

This change reverts the following previous change:
fixes [Custom backgroundColor on Chip makes it flicker between state transitions](https://github.com/flutter/flutter/issues/146730)

### Example preview
![Screenshot 2024-05-28 at 17 40 00](https://github.com/flutter/flutter/assets/48603081/b9117ed2-5afa-4d65-93ae-aa866772ffa1)

https://github.com/flutter/flutter/assets/48603081/a4949ce7-f38b-4251-8201-ecc570ec447c
2024-06-06 20:35:18 +00:00
Taha Tesser
0a546705b4
Introduce ChipAnimationStyle to override default chips animations durations (#149245)
fixes [Custom backgroundColor on Chip makes it flicker between state transitions](https://github.com/flutter/flutter/issues/146730)

### Example preview
![Screenshot 2024-05-28 at 17 40 00](https://github.com/flutter/flutter/assets/48603081/b9117ed2-5afa-4d65-93ae-aa866772ffa1)

https://github.com/flutter/flutter/assets/48603081/a4949ce7-f38b-4251-8201-ecc570ec447c
2024-06-06 19:39:49 +00:00
Polina Cherkasova
d19d19c2d1
Fix leaky test. (#149822) 2024-06-06 11:33:27 -07:00
Jenn Magder
ef386d30c9
Unpin archive package from tool, update to version without security advisories (#149430)
Unpin `archive` version and run  `flutter update-packages --force-upgrade` to show there are no additional dependencies pulled in (url_launcher was updated, but unrelated).

Fixes https://github.com/flutter/flutter/issues/149427
2024-06-06 18:19:19 +00:00
Bruno Leroux
4608a89137
Fix InputDecorator suffixIcon color when in error and hovered (#149643)
## Description

This PRs makes the `InputDecoration.suffixIcon` color compliant with the M3 spec when in error state and hovered.

From M3 spec, the color should be `onErrorContainer`, see https://m3.material.io/components/text-fields/specs#e4964192-72ad-414f-85b4-4b4357abb83c

![image](https://github.com/flutter/flutter/assets/840911/1d8d7bb6-608f-4783-aff5-2123392c4dc1)

## Related Issue

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

## Tests

Updates 2 tests.
2024-06-06 06:11:25 +00:00
Kate Lovett
236b3a716d
Remove abi key from local golden file testing (#149696)
Fixes https://github.com/flutter/flutter/issues/149435

CI does not comprehensively cover all of the possible abi keys, so some folks can't test locally if their machine's abi does not match CI. This just removes it from the local testing look up. The right image will be summoned, and in CI we can still keep track of it.
2024-06-05 23:51:11 +00:00
chunhtai
c1064da21b
Fixes Router transaction to respect operation order (#149763)
fixes https://github.com/flutter/flutter/issues/142393

The issue is that if routerdelegate mutate its currentConfiguration outside of Router's workflow, the change will be propagate back to routeinformationprovider at the end of the frame.
However if another things trigger router's dependencies change within the same frame. The dependencies will trigger a reparse of the current route which would end up override the currentConfiguration in routerDelegate.

This change introduce a transaction system that each operation will be add to the end of the transaction future so everything will be execute inorder
2024-06-05 23:17:53 +00:00
Qun Cheng
3ed3f31ba6
Add contrastLevel parameter to ColorScheme.fromSeed (#149705)
This PR is to add a parameter `contrastLevel` to `ColorScheme.fromSeed` so that we can construct high contrast `ColorScheme`.

https://github.com/flutter/flutter/assets/36861262/c609c996-5dfe-4c6c-800c-349a99de4256

Related to https://github.com/flutter/flutter/issues/149683
2024-06-05 22:16:08 +00:00
Qun Cheng
6e5f39b5d9
Create CarouselView widget - Part 1 (#148094)
This PR is to create an ["uncontained" Carousel](https://m3.material.io/components/carousel/specs#477de3a1-c9df-4742-baf3-bcd5eeb3764c).

https://github.com/flutter/flutter/assets/36861262/947e6b2c-219f-4c8b-aba1-4a1a010221a7

The rest of the layouts can be achieved by using `Carousel.weighted`: https://github.com/QuncCccccc/flutter/pull/2. The branch of `Caorusel.weighted` PR is based on this PR for relatively easer review. Will request reviews for the part 2 PR once this one is successfully merged in master.
2024-06-05 21:03:21 +00:00
Andrew Kolos
1cf617812b
[flutter_tools] Remove additional listener on VM service that simply logged incoming messages (#149756)
In service of #146879. In summary, a bunch of `printTrace` calls were added to try to troubleshoot this flake, but the flake has stopped happening.

This PR more-or-less reverts https://github.com/flutter/flutter/pull/148596, since this was the only change that could have _theoretically_ (somehow maybe) stopped the flake. I'll consider reverting the rest of the `printTrace` calls if the flake does not reappear after this PR lands.
2024-06-05 20:54:53 +00:00
LongCatIsLooong
8ce3bfb6ca
Remove temporary LayoutBuilder migration flag, defer markNeedsLayout (#149637)
Looks like I did not need this flag since flutter_portal pinned flutter version to 3.10 in their presubmits. 

I'll create a g3 fix for this since there're only a handful of scuba failures. Also a g3 test revealed a problem with calling `renderObject.markNeedsLayout` directly. It has to be deferred so the render tree is clean during the idle phase and the postFrameCallback phase.
2024-06-05 20:51:04 +00:00
auto-submit[bot]
27e06569a1
Reverts "TreeSliver & associated classes (#147171)" (#149754)
Reverts: flutter/flutter#147171
Initiated by: QuncCccccc
Reason for reverting: tree is red due to a test in this PR
Original PR Author: Piinks

Reviewed By: {QuncCccccc, TahaTesser, bleroux}

This change reverts the following previous change:
**FYI for Reviewers:** Much of the API surface matches that of the 2D TreeView in https://github.com/flutter/packages/pull/6592. If it changes here, it should change there, and vice versa.

📜  [Design Document](https://docs.google.com/document/d/1-aFI7VjkF9yMkWpP94J8T_JREDS-M3bOak26PVehUYg/edit?usp=sharing)

This adds classes and associated callbacks and controllers for TreeSliver. Core components:
- TreeSliver
- RenderTreeSliver
- TreeSliverNode
- TreeSliverController
- TreeSliverStateMixin
- TreeSliverIndentationType

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

https://github.com/flutter/flutter/assets/16964204/3facd095-7262-4068-aa33-d713e2deca99

https://github.com/flutter/flutter/assets/16964204/f851ae30-8e71-45c7-82a4-9606986a5872
2024-06-05 17:17:19 +00:00
Peter Trost
39472d9b61
Feature: Add AnimatedList with separators (#144899)
This PR adds `AnimatedList.separated`. A widget like an AnimatedList with animated separators. `animated_list_separated.0.dart` extends `animated_list.0.dart` to work with `AnimatedList.separated`

Related issue: https://github.com/flutter/flutter/issues/48226
2024-06-05 15:20:07 +00:00
auto-submit[bot]
ec9965bd89
Reverts "Request focus if SemanticsAction.focus is sent to a focusable widget (#142942)" (#149741)
Reverts: flutter/flutter#142942
Initiated by: zanderso
Reason for reverting: Seems to have affected iOS platform view focus: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20native_platform_view_ui_tests_ios/10626/overview
Original PR Author: gspencergoog

Reviewed By: {yjbanov, goderbauer, chunhtai}

This change reverts the following previous change:
## Description

This causes the `Focus` widget to request focus on its focus node if the accessibility system (screen reader) focuses a widget via the `SemanticsAction.focus` action.

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

## Tests
 - Added a test to make sure that focus is requested when `SemanticsAction.focus` is sent by the engine.
2024-06-05 14:54:18 +00:00
Greg Spencer
dd700e6d7c
Request focus if SemanticsAction.focus is sent to a focusable widget (#142942)
## Description

This causes the `Focus` widget to request focus on its focus node if the accessibility system (screen reader) focuses a widget via the `SemanticsAction.focus` action.

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

## Tests
 - Added a test to make sure that focus is requested when `SemanticsAction.focus` is sent by the engine.
2024-06-05 00:42:59 +00:00
Kate Lovett
b50eb97b7d
TreeSliver & associated classes (#147171)
**FYI for Reviewers:** Much of the API surface matches that of the 2D TreeView in https://github.com/flutter/packages/pull/6592. If it changes here, it should change there, and vice versa.

📜  [Design Document](https://docs.google.com/document/d/1-aFI7VjkF9yMkWpP94J8T_JREDS-M3bOak26PVehUYg/edit?usp=sharing)

This adds classes and associated callbacks and controllers for TreeSliver. Core components:
- TreeSliver
- RenderTreeSliver
- TreeSliverNode
- TreeSliverController
- TreeSliverStateMixin
- TreeSliverIndentationType

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

https://github.com/flutter/flutter/assets/16964204/3facd095-7262-4068-aa33-d713e2deca99

https://github.com/flutter/flutter/assets/16964204/f851ae30-8e71-45c7-82a4-9606986a5872
2024-06-04 22:50:06 +00:00
chunhtai
72b45e1dfd
Prepares semantics_update_test for upcoming heading level changes (#149671)
The pr https://github.com/flutter/engine/pull/41435 adds a new property into updateNode. 

The pr migrate the method in framework first to unblock the engine pr
2024-06-04 22:24:11 +00:00
Gray Mackall
9d1de7b674
Identify and re-throw our dependency checking errors in flutter.groovy (#149609)
The application of the `dependency_version_checker` gradle plugin is wrapped in a try catch, which prevented blocking the build in https://github.com/flutter/flutter/pull/149204. This pr re-throws the errors we intended to throw.
2024-06-04 22:06:25 +00:00
Hans Muller
92f8455ff8
Scrollbar thumb drag gestures now produce one start and one end scroll notification (#146654)
The scroll notification events reported for a press-drag-release gesture within a scrollable on a touch screen device begin with a `ScrollStartNotification`, followed by a series of `ScrollUpdateNotifications`, and conclude with a `ScrollEndNotification`. This protocol can be used to defer work until an interactive scroll gesture ends. For example, you might defer updating a scrollable's contents via network requests until the scroll has ended, or you might want to automatically auto-scroll at that time. 

In the example that follows the CustomScrollView automatically scrolls so that the last partially visible fixed-height item is completely visible when the scroll gesture ends. Many iOS applications do this kind of thing. It only makes sense to auto-scroll when the user isn't actively dragging the scrollable around.

It's easy enough to do this by reacting to a ScrollEndNotifcation by auto-scrolling to align the last fixed-height list item ([source code](https://gist.github.com/HansMuller/13e2a7adadc9afb3803ba7848b20c410)).

https://github.com/flutter/flutter/assets/1377460/a6e6fc77-6742-4f98-81ba-446536535f73

Dragging the scrollbar thumb in a desktop application is a similar user gesture. Currently it's not possible to defer work or auto-scroll (or whatever) while the scrollable is actively being dragged via the scrollbar thumb because each scrollbar thumb motion is mapped to a scroll start - scroll update - scroll end series of notifications.  On a desktop platform, the same code behaves quite differently when the scrollbar thumb is dragged.

https://github.com/flutter/flutter/assets/1377460/2593d8a3-639c-407f-80c1-6e6f67fb8c5f

The stream of scroll-end events triggers auto-scrolling every time the thumb moves. From the user's perspective this feels like a losing struggle.

One can also detect the beginning and end of a touch-drag by listening to the value of a ScrollPosition's `isScrollingNotifier`. This approach suffers from a similar problem: during a scrollbar thumb-drag, the `isScrollingNotifier` value isn't updated at all.

This PR refactors the RawScrollbar implementation to effectively use a ScrollDragController to manage scrolls caused by dragging the scrollbar's thumb. Doing so means that dragging the thumb will produce the same notifications as dragging the scrollable on a touch device.

Now desktop applications can choose to respond to scrollbar thumb drags in the same that they respond to drag scrolling on a touch screen. With the changes included here, the desktop or web version of the app works as expected, whether you're listing to scroll notifications or the scroll position's `isScrollingNotifier`.

https://github.com/flutter/flutter/assets/1377460/67435c40-a866-4735-a19b-e3d68eac8139

This PR also makes the second [ScrollPosition API doc example](https://api.flutter.dev/flutter/widgets/ScrollPosition-class.html#cupertino.ScrollPosition.2) work as expected when used with the DartPad that's  part of API doc page.

Desktop applications also see scroll start-update-end notifications due to the mouse wheel.  There is no touch screen analog for the mouse wheel, so an application that wanted to enable this kind of auto-scrolling alignment would have to include a heuristic that dealt with the sequence of small scrolls triggered by the mouse wheel. Here's an example of that: [source code](https://gist.github.com/HansMuller/ce5c474a458f5f4bcc07b0d621843165). This version of the app does not auto-align in response to small changes, wether they're triggered by dragging the scrollbar thumb of the mouse wheel.

Related sliver utility PRs: https://github.com/flutter/flutter/pull/143538,  https://github.com/flutter/flutter/pull/143196, https://github.com/flutter/flutter/pull/143325.
2024-06-04 22:02:12 +00:00
Victoria Ashworth
529a4d2bac
Disable sandboxing for macOS apps and tests in CI (#149618)
macOS 14 added new requirements that un-codesigned sandbox apps must be granted access when changed. Waiting for this UI caused macOS tests to fail on macOS 14 because the test runner forced codesigning off. Additionally, adding codesigning is not sufficient, since it must still be approved before codesigning is enough to pass the check. As a workaround, this PR disables sandboxing for macOS apps/tests in CI.

![Screenshot 2024-05-30 at 2 41 33 PM](https://github.com/flutter/flutter/assets/682784/1bc32620-5edb-420a-866c-5cc529b2ac55)

https://developer.apple.com/documentation/updates/security#June-2023)
> App Sandbox now associates your macOS app with its sandbox container using its code signature. The operating system asks the person using your app to grant permission if it tries to access a sandbox container associated with a different app. For more information, see [Accessing files from the macOS App Sandbox](https://developer.apple.com/documentation/security/app_sandbox/accessing_files_from_the_macos_app_sandbox).

And that link explains why this is happening on a macOS 14 update:

> In macOS 14 and later, the operating system uses your app’s code signature to associate it with its sandbox container. If your app tries to access the sandbox container owned by another app, the system asks the person using your app whether to grant access. If the person denies access and your app is already running, then it can’t read or write the files in the other app’s sandbox container. If the person denies access while your app is launching and trying to enter the other app’s sandbox container, your app fails to launch.
> 
> The operating system also tracks the association between an app’s code signing identity and its sandbox container for helper tools, including launch agents. If a person denies permission for a launch agent to enter its sandbox container and the app fails to start, launchd starts the launch agent again and the operating system re-requests access.

Fixes https://github.com/flutter/flutter/issues/149268.
Fixes framework part of https://github.com/flutter/flutter/issues/149264.
Might fix packages issue: https://github.com/flutter/flutter/issues/149329.

Verified framework tests:
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20plugin_test_macos/9/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20run_debug_test_macos/2/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20tool_integration_tests_4_4/2/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20integration_ui_test_test_macos/3/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac%20flavors_test_macos/3/overview
https://ci.chromium.org/ui/p/flutter/builders/staging.shadow/Mac_benchmark%20complex_layout_scroll_perf_macos__timeline_summary/6/overview
2024-06-04 21:51:19 +00:00
Greg Spencer
ea8ae8c81b
Allow find.byTooltip to use a RegEx (#149348)
## Description

This adds the ability for `find.byTooltip` to use a `RegEx` to match the tooltip.

Also, adds some tests for `byTooltip`, since there weren't any.

## Tests
 - added tests
2024-06-04 21:43:06 +00:00
Tong Mu
c246ecdf8e
Fix the scrolling layout deviation of CupertinoActionSheet (#149439)
This PR changes `CupertinoActionSheet`'s layout algorithm, so that the actions section always has the lower priority to take up vertical space with a fixed minimum height of 84.3 px. 

Currently `CupertinoActionSheet` uses a very complicated rule the determine the sizes of various sections:
1. If there are <= 3 buttons and a cancel button, or 1 button without a cancel button, then the actions section should never scroll.
2. Otherwise, then the content section takes priority to take over spaces but must leave at least `actionsMinHeight` for the actions section.

This has been the case since `CupertinoActionSheet` was first introduced ([first PR](https://github.com/flutter/flutter/pull/19232)). Maybe it was the case before, but it's no longer reproducible on the latest SwiftUI.

The following images for comparison (left to right: Current Flutter, Flutter after this PR, SwiftUI). Pay attention to whether the actions section scrolls. (There are also some height/padding issues, which will be fixed in a future PR.)

Two buttons:
<img width="1006" alt="image" src="https://github.com/flutter/flutter/assets/1596656/27ca5df7-1140-4bfd-9a5f-3b5972632c92">

Three buttons:
<img width="1025" alt="image" src="https://github.com/flutter/flutter/assets/1596656/f2be6a5c-1713-4ffe-9705-27a668e5133d">

Four buttons:
<img width="1024" alt="image" src="https://github.com/flutter/flutter/assets/1596656/5b90d9f4-11ed-4c04-bdea-0b81b1d2bd3d">

In SwiftUI, the action section seems to always have a minimum height of ~84 pixels regardless of the number of buttons. Therefore this PR also fixed this behavior, and adjusted the related tests.
2024-06-04 01:06:22 +00:00
Brandon DeRosier
02bc11c9be
Place flutter_gpu in the package cache. (#149299)
Resolves https://github.com/flutter/flutter/issues/131711.

Fetch https://storage.googleapis.com/flutter_infra_release/flutter/${engine_version}/flutter_gpu.zip and extract it into the package cache.

Cannot function until https://github.com/flutter/engine/pull/53107 has been merged/rolled into the framework.
2024-06-03 22:46:02 +00:00
flutter-pub-roller-bot
99cf2b6e5a
Roll pub packages (#149617)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-03 22:15:41 +00:00
chunhtai
6ec1c75ac7
Fixes multi line textfield hint text gets ellipsized (#148423)
fixes https://github.com/flutter/flutter/issues/148353
2024-06-03 22:03:06 +00:00
Greg Price
5e448f4ce5
Support failures-only and silent reporters in flutter test (#148739)
Fixes #148738.

Also add some tests for this part of the `flutter test` CLI.
2024-06-03 19:44:39 +00:00
Tong Mu
691a18df5f
[CupertinoActionSheet] Fix overflow of the overscroll section when the user scrolls far (#149542)
When I implemented https://github.com/flutter/flutter/pull/149334, there was a bug that if the actions section is overscrolled for too far (typically due to a fling), the overscroll background might be so long that it overflows the actions section. This PR fixes this bug.
2024-06-03 19:12:11 +00:00
Bruno Leroux
e02d29d52e
Fix InputDecorator.prefixIcon color when disabled (#149595)
## Description

This PRs makes the `InputDecoration.prefixIcon` color compliant with the M3 spec.

From M3 spec, the color should be `onSurface.withOpacity(0.38)`, see https://m3.material.io/components/text-fields/specs#e4964192-72ad-414f-85b4-4b4357abb83c

![image](https://github.com/flutter/flutter/assets/840911/298d9aaf-fcda-479a-a8dd-0ee84db98242)

## Related Issue

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

## Tests

Updates 2 tests.
2024-06-03 18:53:16 +00:00
Dacian Florea
a92318dd98
Added filter callback on dropdown menu (#143939)
DropdownMenu can now customize its filter using the new parameter DropdownMenu.filterCallback, similar to DropdownMenu.searchCallback.
2024-06-03 11:19:29 -07:00
Andrew Kolos
be724796aa
update generated localized message files in the stocks test app (#148741)
Fixes https://github.com/flutter/flutter/issues/149386. Fixes https://github.com/flutter/flutter/issues/106150.

The stocks test app includes Dart files containing localized messages generated by `package:flutter_localizations`. However, these files appear to have become out of date. Running `pub get` in the project will regenerate these files and generate a diff, which can be annoying when working on the repo.

This PR generates the files. ~~It also updates the templates for these files to be compliant with flutter/flutter repo lint rules, including `noop_primitive_operations` and `use_super_parameters`.~~ It also adds `// ignore_for_file: type=lint` to these files to disable linting for these files. This avoids issues like  https://github.com/flutter/flutter/issues/106150 and [this](https://github.com/flutter/flutter/pull/148741#issuecomment-2141161753).
2024-06-03 18:08:19 +00:00
Aditya Dwivedi
0e7295fd18
Add a simplified SimpleCascadingMenuApp example (#149147)
The current MenuAnchor example in the API Docs is comprehensive and complicated for beginners. I have added a simple bare bone example without shortcuts, enums, etc in examples/api/lib/material/menu_anchor/ as `menu_anchor.3.dart`. The example is contributed by @mafreud

Fixes https://github.com/flutter/flutter/issues/148104
2024-06-03 17:11:36 +00:00
LongCatIsLooong
8e15e56c81
Reland "Prevent LayoutBuilder from rebuilding more than once (#147856)" (#149303)
Diff commit: a3f7acab0c

In the failing tests the debugger treated the exception thrown by `Element.rebuild` as a caught exception in the absence of the vm pragma.
2024-06-03 16:45:23 +00:00
auto-submit[bot]
fc8ab3b4b4
Reverts "Fix InputDecorator default hint text style on M3 (#148944)" (#149448)
Reverts: flutter/flutter#148944
Initiated by: loic-sharma
Reason for reverting: This caused Skia golden changes that might be unexpected. We can reland once we confirm these changes are expected, or, fixed the changes to the floating label.
Original PR Author: bleroux

Reviewed By: {Renzo-Olivares, guidezpl}

This change reverts the following previous change:
## Description

This PRs makes the `InputDecoration.hintText` style compliant with the M3 spec.
The hint style is not clearly specified in https://m3.material.io/components/text-fields/specs, but it is in the M3 Figma kit.
('hint' terminology came from the Material1 specification, since M2 the terminology is 'Placeholder').

See this Figma screenshot taken while focusing on the 'Placeholder' text (which corresponds to hint).

![image](https://github.com/flutter/flutter/assets/840911/58d3d5c9-0984-497a-9d47-4724dcd7b2b3)

It seems that the intention is that the 'Placeholder' colors should be the same as the 'supporting text' ones, that is why is reused 'supporting text' tokens.

## Related Issue

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

## Tests

Updates several tests.
2024-05-31 22:06:26 +00:00
Bruno Leroux
df17f36238
InputDecorator M3 tests migration - prefixIcon/suffixIcon (#149437)
## Description

This PR adds several tests tp check M3 specification compliance for `InputDecorator.prefixIcon` and `InputDecorator.suffixIcon`.

This is somewhat repetitive but it helped me to catch several styling and positionning issues, I added TODOs because I will file the fixes once this PR is merged (just in case the fixes break some Google tests). 

## Related Issue

Part of https://github.com/flutter/flutter/issues/139076
2024-05-31 21:13:24 +00:00
Kevin Moore
dd2d123806
_NoOpCodec review feedback (#149442) 2024-05-31 21:03:27 +00:00
engine-flutter-autoroll
86321ed229
Manual roll Flutter Engine from e19d7cde4686 to fa3065875564 (2 revisions) (#149436)
Manual roll requested by jacksongardner@google.com

e19d7cde46...fa30658755

2024-05-31 skia-flutter-autoroll@skia.org Manual roll Dart SDK from ef405fbe3917 to 2976c1694eed (6 revisions) (flutter/engine#53149)
2024-05-31 skia-flutter-autoroll@skia.org Roll Skia from b1e59e25696a to ce975ddfd9fb (1 revision) (flutter/engine#53147)

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 jacksongardner@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-05-31 20:59:53 +00:00
Bruno Leroux
b201fbdee5
Fix InputDecorator default hint text style on M3 (#148944)
## Description

This PRs makes the `InputDecoration.hintText` style compliant with the M3 spec.
The hint style is not clearly specified in https://m3.material.io/components/text-fields/specs, but it is in the M3 Figma kit.
('hint' terminology came from the Material1 specification, since M2 the terminology is 'Placeholder').

See this Figma screenshot taken while focusing on the 'Placeholder' text (which corresponds to hint).

![image](https://github.com/flutter/flutter/assets/840911/58d3d5c9-0984-497a-9d47-4724dcd7b2b3)

It seems that the intention is that the 'Placeholder' colors should be the same as the 'supporting text' ones, that is why is reused 'supporting text' tokens.

## Related Issue

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

## Tests

Updates several tests.
2024-05-31 20:56:07 +00:00
Tong Mu
2b700dda38
Rewrite CupertinoActionSheet, and fix layout deviation (#149334)
This PR rewrite `CupertinoActionSheet` to be based on layout widgets instead of the custom layout code in `_CupertinoDialogRenderWidget`, making it much easier to understand. It also fixes a layout deviation from SwiftUI, and add a few tests.

`_CupertinoDialogRenderWidget` is a custom layout widget that contains too much boilerplate code and is hard to understand where is customized. The plan is to replace it with widgets as much as possible. (Since this widget is used by both `CupertinoActionSheet` and `CupertinoAlertDialog`, this PR only removes the branches related to `isActionSheet`).

The need to use custom layout widget probably came from the following difficulties:
1. The parent needs to know whether an action button is being pressed to correctly render or hide each divider, but the action button is provided by the user as a built widget that also needs to respond to the tap gesture.
2. The main sheet's column needs to _prioritize_ allocating the space to the content section before allocating the remaining to the actions section, while also leaving the actions section a minimum height. This is not supported by simply `Column`.
3. The minimum height of the action section is a non-trivial algorithm.

Luckily, I've found out that all these problems are solvable with widgets.

All existing tests pass.
2024-05-31 20:56:04 +00:00
Dawid Wenderski
84cff3166d
Fix incorrect behavior of ScrollViewKeyboardDismissBehavior.onDrag for ScrollViewers with Drawer (#148948)
Fixes https://github.com/flutter/flutter/issues/141542
Fixes https://github.com/flutter/flutter/issues/103544
Fixes https://github.com/flutter/flutter/issues/54277
2024-05-31 20:30:09 +00:00
Kevin Moore
de26ec8360
DRY up FakeCodec (#149381)
- dedupe the same class in two places
- renamed it to not clash with `FakeCodec` defined somewhere else
2024-05-31 20:24:20 +00:00
Yegor
6193615f90
Wire up SemanticsAction.focus to the framework (#149374)
Wire up `SemanticsAction.focus` to `Semantics` and `CustomPaint`. Reenable respective tests, and add `focus` tests to them.

Contributes to a fix for https://github.com/flutter/flutter/issues/83809
2024-05-31 19:30:18 +00:00
Runar Heggset
b7169ed5be
Use correct type for abi version code (#149087)
After upgrading flutter to the latest version (3.22.1), I encountered an error when building with `--split-per-abi`:

```
[   +1 ms] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script '/home/runar/snap/flutter/common/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1182
[        ] * What went wrong:
[        ] A problem occurred evaluating root project 'android'.
[        ] > A problem occurred configuring project ':app'.
[        ]    > org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'null' to class 'int'.
Try 'java.lang.Integer' instead
```

This PR changes the type used from `ìnt` to `Integer` which is what's used in the `ABI_VERSION` map.
2024-05-31 17:49:16 +00:00