21212 Commits

Author SHA1 Message Date
Andrew Kolos
06e2b18173
[tools] use Java class for all java-searching behavior (#127354)
Fixes #124252, finishing work on the umbrella tracking issue, #126126.

Essentially, after this PR, no (non-test) code should be be referencing/invoking the java home or binary paths.
2023-06-01 04:19:19 +00:00
Loïc Sharma
071ea49248
[Windows] Address feedback for show window comment (#127998)
Address Tong's feedback here: https://github.com/flutter/flutter/issues/127695#issuecomment-1564884872

Follow-up to: https://github.com/flutter/flutter/pull/127046
2023-05-31 23:42:54 +00:00
Tae Hyung Kim
5596a0cdab
Fix gen-l10n format: true so that it applies to when it gets called via build target (#127886) 2023-05-31 15:25:54 -07:00
Greg Spencer
a257efc284
Fix handling of AppLifecycleState.hidden (#127987)
## Description

This fixes the parsing of `AppLifecycleState` in the services binding so that it knows what it is.

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

## Tests
 - Added a test that causes parsing of all the different app lifecycle states.
2023-05-31 22:03:06 +00:00
Tae Hyung Kim
5fd9ef4240
Fix SliverPersistentHeader interactions with SliverCrossAxisGroup (#127338)
This PR fixes `SliverCrossAxisGroup` so that once we calculate the total `scrollExtent` of the `SliverCrossAxisGroup`, we ensure that any child sliver is not painted outside of the "scroll extent" of the sliver group.

https://github.com/flutter/flutter/assets/2004742/670dc6f9-a3c6-4bcc-85d3-576cf7f33c6a

https://github.com/flutter/flutter/assets/2004742/0c9cd951-c133-4a8b-9e5e-89d0a69a4f59

Fixes #126958.
Fixes #126957.
2023-05-31 22:01:06 +00:00
Renzo Olivares
83f19be250
Fix bottom sheet rebuilding when tapping (#127526)
This fixes an issue where the bottom sheet would rebuild when `enableDrag` is set to true on every tap. This is because `DragGestureRecognizer` would win the arena by default and dispatch the `drag` callbacks (in `acceptGesture`) even though it had not met the drag threshold. This changes keep the default behavior of `DragGestureRecognizer` the same, but adds a parameter `onlyAcceptDragOnThreshold` that a user can use to stop drag callbacks from being fired when the drag threshold has not been met.

Fixes #126833
2023-05-31 20:21:55 +00:00
Flutter GitHub Bot
347e304ef6
Roll pub packages (#127977)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-05-31 20:18:25 +00:00
hangyu
a829b579d6
Add a FocusSemanticEvent (#126171)
issue: #94523
engine pr: https://github.com/flutter/engine/pull/41777
2023-05-31 20:15:52 +00:00
Mouad Debbar
7eecf8874f
[web] Use PlatformLocation from ui_web (#126851)
Remove the following APIs and export them directly from `dart:ui_web`:
- `urlStrategy` getter and setter
- `HashUrlStrategy`
- `PlatformLocation` and `BrowserPlatformLocation` (keep the façades for non-web platforms)

Depends on https://github.com/flutter/engine/pull/42043
Depends on https://github.com/flutter/engine/pull/42252

Part of https://github.com/flutter/flutter/issues/126831
2023-05-31 17:35:50 +00:00
Tomasz Gucio
ab3602b7df
Use paragraph getter in TextPainter (#127607) 2023-05-31 12:14:16 +02:00
Ian Hickson
1309f977be
Clarify PointerSignalResolver.register (#127605) 2023-05-31 01:54:20 +00:00
Christopher Fujino
0763d61f56
[flutter_tools] manually roll pub deps (#127447)
Fixes https://github.com/flutter/flutter/issues/127226
2023-05-30 23:34:52 +00:00
Tomasz Gucio
1b5899a4c5
Avoid catching FlutterError in TextPainter tests (#127604) 2023-05-30 19:41:08 +02:00
Tomasz Gucio
90afc5e854
Take paint offset into account for Editable children (#127843) 2023-05-30 19:32:10 +02:00
chunhtai
2f521a2143
Increases the eyeballed value of auto scroll velocity scalar (#127410)
A previous pr fixed an bug in the autoscalar's speed calculation. The calculation would produce much lower speed after the fix. This pr raised the default scalar value for reorderable list.

fixes https://github.com/flutter/flutter/issues/121603
2023-05-30 17:28:19 +00:00
Matheus Kirchesch
f1c8723a10
Added option to disable [NavigationRailDestination]s (#127113) 2023-05-30 08:38:05 -07:00
Taha Tesser
918aa9e485
Update Material 2 tests group comment (#127796)
fixes https://github.com/flutter/flutter/issues/127795
2023-05-30 06:15:28 +00:00
Taha Tesser
9bce790162
Updated the ToggleButtons API doc to link to SegmentedButton (#127021)
fixes https://github.com/flutter/flutter/issues/124884
2023-05-27 00:27:19 +00:00
Nate Bosch
0b9cd86546
Remove more test_api/src imports (#127716)
Replace imports of `src/remote_listener.dart` with `backend.dart` which exports `RemoteListener`.

Remove the unused imports of `src/backend/stack_trace_formatter.dart` (no uses of `StackTraceFormatter`) and
`src/backend/suite_channel_manager.dart` (no uses of `SuiteChannelManager`).
2023-05-26 23:47:35 +00:00
LongCatIsLooong
b5df180a6f
Move shared inline widget logic to RenderInlineWidgetContainerDefaults (#127308)
- Added `InlineWidgetContainerDefaults` for deduping inline widget code
- Added a helper function `WidgetSpan.extractFromInlineSpan` for extracting `WidgetSpan`s and automatically applying text scaling (at widget level)
- Removed `TextPainter.inlinePlaceholderScales`. I'm going to deprecate the `scale` argument in `TextPainter.addPlaceholder` next, as scaling is now done at the widget level.
- Added runtime check and comments to make sure nobody is extending `PlaceholderSpan` directly (unfortunately we can't remove `PlaceholderSpan`  without moving RenderEditable and RenderParagraph to the widgets library).
2023-05-26 23:47:33 +00:00
Phil Quitslund
5bf6318688
Update collection-fors to prefer final (as per updated prefer_final_in_for_each) (#127511)
The newly updated lint will soon flag for-each in collections.

See discussion: https://github.com/dart-lang/linter/pull/4383

/cc @goderbauer
2023-05-26 23:34:36 +00:00
Greg Spencer
0da6f04f07
Remove references to deprecated ThemeData.primaryColorBrightness (#127238)
## Description

Removes references to `ThemeData.primaryColorBrightness`, deprecated in https://github.com/flutter/flutter/pull/93396 and subject to remove now because of our [deprecation policy](https://github.com/flutter/flutter/wiki/Tree-hygiene#deprecations).

## Related PRs
 - https://github.com/flutter/flutter/pull/93396

## Tests
 - Removed unneeded tests, removed references.
2023-05-26 22:33:58 +00:00
Kate Lovett
0f1a95d19e
TwoDimensional scrolling foundation (#125437)
From the 2D scrolling proposal: [flutter.dev/go/2D-Foundation](https://flutter.dev/go/2D-Foundation) ✅  updated 4/25

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

Follow up issues:
- https://github.com/flutter/flutter/issues/126297
- https://github.com/flutter/flutter/issues/126298
- https://github.com/flutter/flutter/issues/126299
-  https://github.com/flutter/flutter/issues/122348

This adds a mostly abstract foundation for 2D scrolling in Flutter.

With these base classes, developers will be able to construct widgets that scroll in both dimensions and can lazily load their children for the best performance. This implementation is meant to be flexible in order to support different kinds of 2D compositions, from tables to scatter plots. 

The upcoming TableView, TreeView, etc widgets (coming soon in flutter/packages) are built on top of this foundation.
2023-05-26 22:22:21 +00:00
Qun Cheng
a4de77a239
Remove button announcement for MenuItemButton and SubmenuButton (#127620) 2023-05-26 13:23:45 -07:00
Victoria Ashworth
8e6a9e3a9e
Revert "Log all lines from ios-deploy (#127502)" (#127684)
This reverts commit a19b3436eead2e64bb2b014f14afcd8fab8c9d32.

We added this logging to try and determine if the reason for Dart VM errors (https://github.com/flutter/flutter/issues/121231) was caused by some issue with the streams.
A recent test proves that is not the case:
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20platform_view_ios__start_up/11046/overview
The test shows the Dart VM url in the device log. However, the test log does NOT show a log for the Dart VM url but does show the stack trace, which all come from the main stream, which means it's not an issue with the secondary streams not receiving the log.

So reverting the debugging we added.
2023-05-26 20:11:54 +00:00
Taha Tesser
5d555eb234
Add M3 date range picker tests and fix header background theme color (#127662) 2023-05-26 13:08:45 -07:00
Reid Baker
9376a2ac60
Support minifcation for apps that depend on AGP 8 and integration_test (#127628)
- Set exported proguard rules for consumers of integration_test using AGP 8.0 
- Updated proguard usage in example to test setting custom proguard rules works.

#127388

Documentation for how consumerProguardFiles works. https://developer.android.com/studio/projects/android-library#Considerations

Unknown why we had to use ** instead of matching exactly.
2023-05-26 19:30:44 +00:00
fzyzcjy
c1558f6979
Fix TextField error in production environment because it wrongly uses ancestor render boxes (#126324)
Fixes a crash in a reparented TextField due to frame render phase timing
2023-05-26 10:49:37 -07:00
Jonathan Green
28605398ec
Interactive viewer doesn't appear to respect the trackpadScrollCausesScale parameter (#127114)
Fix a bug when using InteractiveViewer.trackpadScrollCausesScale
2023-05-26 10:45:56 -07:00
LongCatIsLooong
56808b486d
Remove a bad assert from tooltip implementation (#127629)
Fixes https://github.com/flutter/flutter/issues/127575

The `_handleMouseEnter` and `_handleMouseExit` calls are balanced, but the tooltip could be dismissed by an external `PointerDown` event interacting with a different UI component so the ` assert(_activeHoveringPointerDevices.isNotEmpty);` does not really make sense.
2023-05-26 00:29:27 +00:00
LongCatIsLooong
43de3365f5
Remove rounding from TextPainter (#127099)
To opt-in, run the tests with: `SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 flutter test --dart-define=SKPARAGRAPH_REMOVE_ROUNDING_HACK=1 `

Migration plans:
1. Turn the flags on in CI, migrate customer tests if needed
1. Migrate internal customers
2. Remove the flag from skparagraph. Remove the framework flag with a manual engine roll.

Also fixes https://github.com/flutter/flutter/issues/52038
2023-05-26 00:09:51 +00:00
pdblasi-google
07f7ffde50
Adds TestDisplay API for testing Display features (#127525)
* Adds `TestDisplay`
* Updates `TestPlatformDispatcher` to wrap all `Display`s and relate them to their appropriate `TestFlutterView`
* Updates `TestFlutterView` to tie `devicePixelRatio` to its display as per the documentation on `Display`

Closes #127225
2023-05-26 00:04:05 +00:00
Elias Yishak
cb3b1f8c84
ProcessResultMatcher created and used in test (#127414)
Addresses issues:
- https://github.com/flutter/flutter/issues/127135
- https://github.com/flutter/flutter/issues/99767

Creates a matcher class that we can use for `ProcessResult` to check for the exit code.

*List which issues are fixed by this PR. You must list at least one issue.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2023-05-25 21:20:03 +00:00
Qun Cheng
9fa351807f
SearchBar should not be impacted by overall InputDecorationTheme (#127465) 2023-05-25 12:28:26 -07:00
Dan Field
a21f33e7ad
avoid incorrect usage of TimelineTask (#127527)
This code was added based on a misunderstanding of the API surface.
2023-05-25 09:17:02 -07:00
Taha Tesser
c05a05e6fc
Add ScrollNotificationObserver sample (#127023)
fixes https://github.com/flutter/flutter/issues/126702

### Preview

https://github.com/flutter/flutter/assets/48603081/4c529a0d-b8a5-4950-9095-429f1c5eccbb
2023-05-25 15:58:52 +00:00
LongCatIsLooong
1b800fd496
Remove Tooltip mouse tracker listener & update hovering/MouseRegion logic & animation (#119199)
Fixes https://github.com/flutter/flutter/issues/117627

### Behavior changes:
1. If fade in/fade out animation is already in progress, hiding/showing the tooltip will immediately take effect without waiting for `waitDuration`.
2. A PointerDownEvent that doesn't become a part of a "trigger" gesture dismisses the tooltip, even for hovered ones.
3. The OverlayEntry is now updated only when the previous tooltip was completely dismissed. This can be fixed by OverlayPortal but I'm not sure what the correct behavior is.
2023-05-25 07:24:45 +00:00
Mouad Debbar
2d142c5ba2
[web] ui.platformViewRegistry => ui_web.platformViewRegistry (#127493)
Now that `platformViewRegistry` is [exposed](https://github.com/flutter/engine/pull/41877) through `dart:ui_web`, we can do some cleanup here.

Part of https://github.com/flutter/flutter/issues/126831
2023-05-24 23:31:28 +00:00
lsaudon
7827a24207
Add missing parameters in TextFormField (#127020)
`TextFormField` does not have all the parameters of `TextField`.

Added:
```dart
    UndoHistoryController? undoController,
    AppPrivateCommandCallback? onAppPrivateCommand,
    bool? cursorOpacityAnimates,
    ui.BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
    ui.BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
    DragStartBehavior dragStartBehavior = DragStartBehavior.start,
    ContentInsertionConfiguration? contentInsertionConfiguration,
    Clip clipBehavior = Clip.hardEdge,
    bool scribbleEnabled = true,
    bool canRequestFocus = true,
```
2023-05-24 23:06:52 +00:00
LongCatIsLooong
62e78bf143
Improve TextPainter.layout caching (#118128)
Improves `TextPainter.layout` caching when only the input constraints change: 
- removes the double layout calls in `TextPainter._layoutParagraph`: now double layout is only needed when `TextAlign` is not left, and the input `maxWidth == double.infinity`.  
- skip calls to `ui.Paragraph.layout` when it's guaranteed that there's no soft line breaks before/after the layout call.

This doesn't introduce new APIs but may slightly shift text rendered on screen.
This reduces the number of `layout` calls but since shaping results are already cached so it only skips the relatively cheap line-breaking process when possible.

528 scuba failures but all of them seem reasonable.
2023-05-24 22:38:52 +00:00
Bruno Leroux
2b105ac6dd
Fix ScrollPosition overscroll precision error (#127321)
## Description

This PR fixes a precision error in ~~`ClampingScrollPhysics`~~ `ScrollPosition` that leads to `StretchingOverscrollIndicator` stretching its content unexpectedly in some devices (see  https://github.com/flutter/flutter/issues/126561 where this is visible in `TabBarView` and the test added in this PR where it reproduces with a `PageView`).

~~This PR also contains a change to `nested_scroll_view.dart` because the first change (the one in `ClampingScrollPhysics`)  breaks the precision error test added by https://github.com/flutter/flutter/pull/87801.~~

## Related Issue

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

## Tests

Adds 1 test.
2023-05-24 22:34:06 +00:00
Devin
5451ea6e8f
Slider.onChangeStart & Slider.onChangeEnd are not called on keyboard shortcuts (#126896)
fixes https://github.com/flutter/flutter/issues/123315
--------

This PR makes changes to the _actionHandler function used on the Slider.Dart Widget for Key Events. It ensures onChangeStart is called at the beginning of a Key Event and onChangeEnd at the end of one. This PR includes a test for the changes made.
I ran all existing tests after my changes were made and they passed.
2023-05-24 22:13:15 +00:00
Sun Jiao
7b67aa587a
make suggestionsBuilder in SearchAnchor asyncable (#127019) 2023-05-24 13:12:47 -07:00
Victoria Ashworth
a19b3436ee
Log all lines from ios-deploy (#127502)
Reland https://github.com/flutter/flutter/pull/127222 that was reverted in https://github.com/flutter/flutter/pull/127405.

Fixed `Mac_ios microbenchmarks_ios` test failure by not echoing logs twice.
2023-05-24 19:46:16 +00:00
Victoria Ashworth
555326b228
Revert "Replace rsync when unzipping artifacts on a Mac (#126703)" (#127430)
This reverts commit 2b3cd7f4d9fd522e2e691fbd169c0c0e1fd7c9e8.

Fixes https://github.com/flutter/flutter/issues/127281.
2023-05-24 19:21:05 +00:00
Ian Hickson
9c7a9e779f
Give channel descriptions in flutter channel, use branch instead of upstream for channel name (#126936)
## How we determine the channel name

Historically, we used the current branch's upstream to figure out the current channel name. I have no idea why. I traced it back to https://github.com/flutter/flutter/pull/446/files where @abarth implement this and I reviewed that PR and left no comment on it at the time.

I think this is confusing. You can be on a branch and it tells you that your channel is different. That seems weird.

This PR changes the logic to uses the current branch as the channel name.

## How we display channels

The main reason this PR exists is to add channel descriptions to the `flutter channel` list:

```
ianh@burmese:~/dev/flutter/packages/flutter_tools$ flutter channel
Flutter channels:
  master (tip of tree, for contributors)
  main (tip of tree, follows master channel)
  beta (updated monthly, recommended for experienced users)
  stable (updated quarterly, for new users and for production app releases)
* foo_bar

Currently not on an official channel.
ianh@burmese:~/dev/flutter/packages/flutter_tools$
```

## Other changes

I made a few other changes while I was at it:

* If you're not on an official channel, we used to imply `--show-all`, but now we don't, we just show the official channels plus yours. This avoids flooding the screen in the case the user is on a weird channel and just wants to know what channel they're on.
* I made the tool more consistent about how it handles unofficial branches. Now it's always `[user branch]`.
* I slightly adjusted how unknown versions are rendered so it's clearer the version is unknown rather than just having the word "Unknown" floating in the output without context.
* Simplified some of the code.
* Made some of the tests more strict (checking all output rather than just some aspects of it).
* Changed the MockFlutterVersion to implement the FlutterVersion API more strictly.
* I made sure we escape the output to `.metadata` to avoid potential injection bugs (previously we just inlined the version and channel name verbatim with no escaping, which is super sketchy).
* Tweaked the help text for the `downgrade` command to be clearer.
* Removed some misleading text in some error messages.
* Made the `.metadata` generator consistent with the template file.
* Removed some obsolete code to do with the `dev` branch.

## Reviewer notes

I'm worried that there are implications to some of these changes that I am not aware of, so please don't assume I know what I'm doing when reviewing this code. :-)
2023-05-23 19:59:20 +00:00
Tomasz Gucio
25d2f90a59
Avoid catching errors in TextPainter tests (#127307) 2023-05-23 21:20:59 +02:00
Christopher Fujino
11cb29174f
[flutter_tools] delete entitlements files after copying to macos build dir (#127417)
Fixes https://github.com/flutter/flutter/issues/126705

Follow up fix after https://github.com/flutter/flutter/pull/126875 did NOT work.
2023-05-23 19:12:11 +00:00
NikolajHarderNota
c84b10474c
modal bottom sheet barrier label (#126431)
Adds barrierLabel as optional param in showModalBottomSheet

Fixes #83180
2023-05-23 18:59:49 +00:00
Justin McCandless
4341ed4229
Fix the breaking of multi-code-unit characters in obscure mode (#123366)
This PR changes the character boundary behavior of obscured fields to be based on code points instead of code units.

So it used to be possible to traverse and delete obscured text inside of code points (and breaking a code point like that would cause a crash):

![output2](https://github.com/flutter/flutter/assets/389558/674c89a4-c47d-4cdc-a402-4cadb5d2f73b)

But now moving the cursor and deleting is based on code points:

![output1](https://github.com/flutter/flutter/assets/389558/e46301f7-b5af-48d2-812a-0ad649f1383b)

### Native behavior

Native iOS deletes part of the emoji, native Mac deletes the whole emoji.  See https://github.com/flutter/flutter/issues/122381#issuecomment-1482042620.  So it's unclear what the desired behavior should actually be.

### Resources

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

I thought this might not fix the case where a broken emoji is directly pasted into the field, but it seems to work by trying this:  �‍👩‍👦‍👦

CC @LongCatIsLooong
2023-05-23 18:21:10 +00:00