Commit Graph

21639 Commits

Author SHA1 Message Date
Kate Lovett
a5b06f15a0 Fix visual overflow for SliverMainAxisGroup (#132989)
Fixes https://github.com/flutter/flutter/issues/132788

The SliverGeometry was not set properly for SliverMainAxisGroup. Omitting hasVisualOverflow affected the Viewport's choice to apply a clip, leading to the sliver being rendered outside of the bounds of the viewport.
2023-08-22 01:46:23 +00:00
Matan Lurey
a021015ef6 Always require --local-engine-host if --local-engine (#133003)
Closes #132245.
2023-08-22 01:32:14 +00:00
Angelo Silvestre
f9b91734a1 Add deleteBackwardByDecomposingPreviousCharacter mapping for tests (#132919)
In  `MacOSTestTextInputKeyHandler`, there are some mappings from shortcuts to generate macOS selectors. However, `ctrl + backspace` isn't mapped to `deleteBackwardByDecomposingPreviousCharacter:`.

This PR adds the mapping for `deleteBackwardByDecomposingPreviousCharacter:`.

Fixes: https://github.com/flutter/flutter/issues/132917
2023-08-21 23:27:19 +00:00
Justin McCandless
8e95ee2e96 Docs on iOS's directional quote characters (#132869)
When you type a single or double quote character on the default iOS keyboard, it doesn't actually insert the usual `'` or `"`.  Instead, it inserts a directional version that tries to match with others.  This is very tricky when allow/deny-listing characters, so I've added a section about this to the docs.

Fixes https://github.com/flutter/flutter/issues/132232
2023-08-21 19:02:33 +00:00
fzyzcjy
aeddab428d When resized network image has error, all future unrelated images using the same url will fail, even if the network becomes OK (#127456)
Close #127265

The CI fails because of simple analyzer errors. Thus, I would like to hear your opinions first!
2023-08-21 17:12:06 +00:00
Jackson Gardner
6f227c0784 Space character should be optional when tree shaking fonts (#132880)
Addresses the other part of https://github.com/flutter/flutter/issues/132711
2023-08-19 02:04:15 +00:00
Renzo Olivares
2ecb8866a2 SelectionArea on iOS should toggle the context menu when tapping on the previous selection (#132851)
https://github.com/flutter/flutter/assets/948037/210fdee4-d922-422b-a257-4ee586a3814f

Related: https://github.com/flutter/flutter/issues/129583
2023-08-18 23:45:16 +00:00
chunhtai
61242fa13b Updates app link gradle tasks and remove vm services (#131805)
1. Remove vm service registration
2. combine print<variant>ApplicationId and print<variant>AppLinkDomain into one task dump<variant>AppLinkSettings, which dump all the data in a json file

The deeplink validation tool will be a static app in devtool instead of regular app. A Static app doesn't require a running app; therefore, we can't call these API through vmservices. I decided to convert these API into flutter analyzer command, which will be done in a separate PR https://github.com/flutter/flutter/pull/131009.

The reason these print tasks are converted into file dumps is to reduce the amount of data encoding and decoding. Instead of passing data through stdout, the devtool can read the files generated by gradle tasks instead.
2023-08-18 18:42:58 +00:00
Mustafa Ateş Uzun
6875827f46 doc: add flag params (#132485)
*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.*

*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-08-18 17:48:05 +00:00
gmilou
58019b3428 Add a new MatrixTransition and refactor ScaleTransition and RotationT… (#131084)
…ransition to derive from it.

The MatrixTransition class uses a callback to handle any value => Matrix animation.

The alignment and filterQuality logic that was in ScaleTransition and RotationTransition is now factored in MatrixTransition.

The ScaleTransition.scale and RotationTransition.turns getters had to be kept because they're still referenced in https://github.com/flutter/packages/tree/main/packages/animations, and https://github.com/flutter/packages/flutter/test/. I plan to remove the references there, once this PR is generally available, and then remove the getters here.

A RotationTransition test was updated to use matrixMoreOrLessEquals because using Matrix4.rotationZ doesn't have the special cases Transform.Rotation had, and zeroes in matrix weren't exactly zeroes.

fixes #130946
2023-08-18 16:50:06 +00:00
Andrey Suvorov
1cfba2620a fixes l10n for CupertinoDatePicker in monthYear mode (#130934)
This PR fixes l10n issue when months names are being used in incorrect form in CupertinoDatePicker in CupertinoDatePickerMode.yearMonth (#130930).

The idea of this proposal is to add an optional parameter `standalone` for `CupertinoLocalizations.datePickerMonth` to be able to choose when to use months names in base form (intl DateSymbols.STANDALONEMONTHS) and when in day-dependent form (intl DateSymbols.MONTHS)

<details>
<summary>Before</summary>

<img width="366" alt="image" src="https://github.com/flutter/flutter/assets/32621121/1dd54fa7-6dd9-4053-889b-57134c145432">

<img width="387" alt="image" src="https://github.com/flutter/flutter/assets/32621121/c176070e-73e4-49d3-883b-ba31eca6d1d7">

</details>

<details>
<summary>After</summary>

<img width="369" alt="image" src="https://github.com/flutter/flutter/assets/32621121/255594f1-219d-4bd4-9b75-1012912f8ab0">

<img width="378" alt="image" src="https://github.com/flutter/flutter/assets/32621121/16bbb41f-3f62-4446-bf41-e27140b649a9">

</details>
2023-08-18 16:38:54 +00:00
Victoria Ashworth
b52297da06 Fix Xcode 15 build failure due to DT_TOOLCHAIN_DIR (#132803)
Starting in Xcode 15, when building macOS, DT_TOOLCHAIN_DIR cannot be used to evaluate LD_RUNPATH_SEARCH_PATHS or LIBRARY_SEARCH_PATHS. `xcodebuild` error message recommend using TOOLCHAIN_DIR instead.

Since Xcode 15 isn't in CI, I tested it in a one-off `led` test:
* [Pre-fix failure](04e485a0b1/+/build.proto)
* [Post-fix success](d454a3e181/+/build.proto)

Fixes https://github.com/flutter/flutter/issues/132755.
2023-08-18 15:24:55 +00:00
Tae Hyung Kim
312ef54115 [flutter_tools] Generate localizations on flutter pub get (#132172)
Currently, flutter pub get generates localizations if there exists an l10n.yaml file where synthetic-package is not false. However, for any user who needs to turn off synthetic-package, their localizations are not generated. This PR should make the behavior more consistent. (Also it seems good to make it so that running flutter pub get once resolves all the dependencies so that people can get to work without running flutter gen-l10n manually.)

Fixes https://github.com/flutter/flutter/issues/84979.
2023-08-18 15:01:09 +00:00
Navaron Bracke
03664d0acb Fix description in index.html / manifest.json getting double quoted (#131842)
This PR adjusts the quoting of the project description not not apply twice in the index.html / manifest.json of web builds.

*List which issues are fixed by this PR. You must list at least one issue.*
Fixes https://github.com/flutter/flutter/issues/131834

*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-08-18 02:58:20 +00:00
Jason Simmons
579991cbb3 Fix the name of the local-engine-host flag in the warning message (#132808) 2023-08-18 00:11:57 +00:00
Justin McCandless
f68d03f1cd Reland root predictive back (#132249)
Root predictive back (https://github.com/flutter/flutter/pull/120385) was reverted in https://github.com/flutter/flutter/pull/132167.  This PR is an attempt to reland it.

The reversion happened due to failed Google tests (b/295073110).
2023-08-17 23:55:05 +00:00
Ian Hickson
d19fb632ec Allow date pickers to not have selected date (#132343)
This enables our various date picker classes to have a null `initialDate`.

It also fixes the logic of some of the widgets which used to do something when you _changed_ the `initial*` parameters, which is wrong for `initial*` properties (they by definition should only impact the initial state) and wrong for properties in general (behaviour should not change based on whether the widget was built with a new value or not, that violates the reactive design principles).

Fixes https://github.com/flutter/flutter/issues/638.
2023-08-17 23:45:57 +00:00
LouiseHsu
3f34b480c8 [Framework] Add Share to selection controls (#132599)
In native iOS, users are able to select text and initiate a share menu, which provides several standard services, such as copy, sharing to social media, direct ability to send to various contacts through messaging apps, etc. 

https://github.com/flutter/engine/assets/36148254/d0af7034-31fd-412e-8636-a06bbff54765

This PR is the framework portion of the changes that will allow Share to be implemented.
The corresponding merged engine PR is [here](https://github.com/flutter/engine/pull/44554)
This PR addresses https://github.com/flutter/flutter/issues/107578
More details are available in this [design doc](https://github.com/flutter/engine/pull/flutter.dev/go/add-missing-features-to-selection-controls)
2023-08-17 23:36:11 +00:00
Polina Cherkasova
aa1bacb35a Leaks fix. (#132778)
Fixes https://github.com/flutter/flutter/issues/132769
2023-08-17 12:11:24 -07:00
Chinmoy
f1d04a46cb Update Scrollable on ScrollBehaviour change. (#131164)
Fixes: #130793
2023-08-17 18:48:57 +00:00
Loïc Sharma
9e67e0e4a1 [Windows] Allow overwriting the cache's Dart SDK archive license file… (#132777)
Relands https://github.com/flutter/flutter/pull/132669 after it was reverted by https://github.com/flutter/flutter/pull/132773. The test failures were fixed separately by https://github.com/flutter/flutter/pull/132766

Tracking issue: https://github.com/flutter/flutter/issues/132592
Cherrypick issue: https://github.com/flutter/flutter/issues/132718
2023-08-17 18:45:18 +00:00
Jason Simmons
609382a8c4 Disable test order randomization on some leak tracker tests that are failing with today's seed (#132766) 2023-08-17 17:40:05 +00:00
yaakovschectman
e10d74b4d5 Revert "[Windows] Allow overwriting the cache's Dart SDK archive license file" (#132773)
Reverts flutter/flutter#132669

Introduced failure on `windows/mac/linux framework_library_tests`.

```
05:41 +7318 ~22 -1: /b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_bar_theme_test.dart: (tearDownAll) [E]                                                                                   
  Expected: leak free
    Actual: <Instance of 'Leaks'>
     Which: contains leaks:
            # The text is generated by leak_tracker.
            # For leak troubleshooting tips open:
            # https://github.com/dart-lang/leak_tracker/blob/main/doc/TROUBLESHOOT.md
            notDisposed:
              total: 3
              objects:
                ValueNotifier<_OverlayEntryWidgetState?>:
                  test: Constructor parameters override theme parameters
                  identityHashCode: 407433615
                FocusScopeNode:
                  test: Constructor parameters override theme parameters
                  identityHashCode: 513181650
                FocusScopeNode:
                  test: Constructor parameters override theme parameters
                  identityHashCode: 704743556
            
  package:matcher                                                                   expect
  package:flutter_test/src/widget_tester.dart 458:18                                expect
  package:leak_tracker_flutter_testing/src/leak_tracking_flutter_testing.dart 81:5  _tearDownTestingWithLeakTracking
  ===== asynchronous gap ===========================
  dart:async                                                                        _CustomZone.registerBinaryCallback
  package:leak_tracker_flutter_testing/src/leak_tracking_flutter_testing.dart 59:9  configureLeakTrackingTearDown.<fn>
```
2023-08-17 17:26:17 +00:00
Loïc Sharma
7ee864ee37 [Windows] Allow overwriting the cache's Dart SDK archive license file (#132669)
https://github.com/flutter/engine/pull/43974 added a license file to the Dart SDK's ZIP archive. As a result, extracting the Dart SDK now needs to overwrite the cache's `LICENSE.dart_sdk_archive.md` file.

This is a short-term solution that will be cherry-picked for the next [3.14 beta release](https://github.com/flutter/flutter/issues/132267). Addresses https://github.com/flutter/flutter/issues/132592.

The long-term solution is tracked by https://github.com/flutter/flutter/issues/132702
2023-08-17 16:08:08 +00:00
Bernardo Ferrari
b7046b32db Improve and optimize non-uniform Borders. (#124417)
~~Using the same priority order as a Border without borderRadius, it is possible to draw them on top of each other. This is better than the current behavior (crash!) and would work well for a "one color on top, another on bottom" scenario.~~

~~With this, if approved, we move the current number of possible exceptions from 4 to 1 (`BoxShape.circle` + `borderRadius`).~~

~~It is kind of odd how `borderRadius.zero` to `borderRadius != BorderRadius.zero` change, but I think it is better than crashing. Alternatively, we just remove the "original function" and see if any goldens are affected.~~

<img width="448" alt="image" src="https://user-images.githubusercontent.com/351125/236550350-7499d758-5b44-40e6-9105-32671eb21998.png">

Another one for @gspencergoog. If this works, we could make the paint method public and re-use in the InputBorder PR (if that's also approved). Single line fix.
2023-08-17 04:04:23 +00:00
Kate Lovett
ca319278bd Fix lower bound of children from TwoDimensionalChildBuilderDelegate (#132713)
Found in https://github.com/flutter/packages/pull/4536

The max x and max y index  should allow for a case where there are no children in the viewport.
This should be CP'd into stable once it lands.
2023-08-17 02:05:06 +00:00
Ian Hickson
8864395034 Improvements to EditableText documentation (#132532) 2023-08-17 01:02:17 +00:00
Matan Lurey
b66878a61e Treat missing --local-engine-host as fatal on CI-like systems. (#132707)
Partial work towards https://github.com/flutter/flutter/issues/132245.

The goal here is to "sniff" out any missing pieces that would block engine builds, rolls, benchmarks and so on before requiring humans to provide the parameter. The implementation is based on a [short discussion with @christopherfujino](https://discord.com/channels/608014603317936148/608022056616853515/1141503921546875110):

@matanlurey:

> Not sure whether to post here or ⁠hackers-infra-🌡 , but is there a way to (and is it advisable to) detect whether the tool is running in a CI environment? I'd like to "soft enforce" --local-engine-host being provided strictly on CI, make sure that lands well, and then "upgrade" it to being non-CI invocations as well (re: https://github.com/flutter/flutter/issues/132245).
>
> Also happy to get talked out of this idea 🙂

@christopherfujino:

> we have a check, lemme find it
> whether or not it is advisable, idk
> https://github.com/flutter/flutter/blob/flutter-3.14-candidate.0/packages/flutter_tools/lib/src/base/bot_detector.dart#L30
>
> (...)
>
> is your desire to get early signal before enforcing t his for humans to prevent functionality churn of landing and reverting and re-landing? 
>
> (yes)
>
> uhh, sure, that's advisable 🙂
2023-08-17 00:41:03 +00:00
Kate Lovett
af0ca97842 Fix bad pattern in 2D tests (#132709)
Fixes some poor tests choices in the 2D tests that were identified in https://github.com/flutter/packages/pull/4536
2023-08-17 00:13:04 +00:00
Polina Cherkasova
1a0077dc81 Upgrade flutter packages. (#132697) 2023-08-16 16:26:58 -07:00
Renzo Olivares
0e15ab54d1 Triple tap selection should not move beyond text boundary at the tapped location (#132357)
This PR makes sure we do not select beyond the text boundary at the tapped position unless, we tap at the end of the text which in that case we should select the previous text boundary.

```dart
    // if x is a boundary defined by `textBoundary`, most textBoundaries (except
    // LineBreaker) guarantees `x == textBoundary.getLeadingTextBoundaryAt(x)`.
    // Use x - 1 here to make sure we don't get stuck at the fixed point x.
    final int start = textBoundary.getLeadingTextBoundaryAt(extent.offset - 1) ?? 0;
```

This was originally carried over from f468f3366c/packages/flutter/lib/src/widgets/editable_text.dart (L4167-L4179) which used this `x - 1` to be able to move to the previous word boundary when navigating with a keyboard. When selecting by tapping/clicking we do not want to move past the text boundary at the tapped position so this adjustment is not needed.

Fixes #132126
2023-08-16 23:05:16 +00:00
Faisal Ansari
2cb762d154 fixed documentation error input decorator (#132124)
In the documentation of _Shaker in InputDecoration "Used to "shake" the floating label to the left and right"
to the left was twice I have removed it.
2023-08-16 23:03:21 +00:00
Polina Cherkasova
0ea523cf93 Fix not-disposed _InputBorderGap. (#132694)
Fixes: https://github.com/flutter/flutter/issues/132620
2023-08-16 22:38:59 +00:00
Matan Lurey
223ae5d3ac Add support for LOCAL_ENGINE_HOST to Linux/Mac/Win builds. (#132579)
Partial work towards https://github.com/flutter/flutter/issues/132245.

I also couldn't help myself to do a very minor refactor and add some comments to `LocalEngineInfo` because I was getting confused myself implementing it.
2023-08-16 22:24:51 +00:00
Michael Goderbauer
14f9ed28d0 Analyze doc code snippets for all packages for which we publish docs (#132607)
Fixes TODO in the analyzer script :)
2023-08-16 22:24:48 +00:00
Polina Cherkasova
112f4293dc Fix some leaks and add test to test cover remaining in a simple way. (#131373)
Contributes to https://github.com/flutter/flutter/issues/130467

Filed issue: https://github.com/flutter/flutter/issues/132620
2023-08-16 18:19:58 +00:00
William Hesse
3423226958 Fix flutter_tools use of --local-engine-host (#132648)
PR #132346 added the use of --local-engine-host to flutter_tools internals, and had an error on one line. Fix that error, to use the correct field name.

The error occurs when building plugins with the changed tools.
2023-08-16 12:00:25 +00:00
Taha Tesser
23315f1b57 [Reland] #131609 (#132555)
This relands https://github.com/flutter/flutter/pull/131609

---

fixes [`PopupMenuItem` adds redundant padding when using `ListItem`](https://github.com/flutter/flutter/issues/128553)
2023-08-16 00:44:06 +00:00
Tong Mu
6971dcb705 Explain the keyboard manager protocol (#132533)
Fixes https://github.com/flutter/flutter/issues/132433
2023-08-15 23:06:58 +00:00
Kate Lovett
9d9427923f Fix extent for null returning builder in GridView (#132511)
Fixes https://github.com/flutter/flutter/issues/130685

This fixes an issue where a GridView/SliverGrid with a SliverChildBuilderDelegate would still reflect a max scroll extent of infinity after returning null from the builder. This change incorporates the same way we handle this case in SliverList:

6d87a23b37/packages/flutter/lib/src/rendering/sliver_list.dart (L305-L307)
2023-08-15 22:56:09 +00:00
Greg Spencer
301577a34f Fixing a memory leak in About box/dialog overlays (#130842)
## Description

Fix three memory leaks detected by `about_test.dart`, but were really in the `Route` and `OverlayEntry` classes.

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

## Tests
 - Updates about_test.dart to not ignore the leaks anymore.
2023-08-15 21:58:21 +00:00
Polina Cherkasova
f0e7c51816 Upgrade flutter packages. (#132585) 2023-08-15 13:50:17 -07:00
Gray Mackall
6b70dc18f5 [integration_test] Update outdated onScreenshot signature in README code snippet (#132409)
Fixes https://github.com/flutter/flutter/issues/126690.

Encountered while testing https://github.com/flutter/flutter/pull/132406. Updates the signature to be in line with the [current typedef](b3096225e0/packages/integration_test/lib/common.dart (L26)).
2023-08-15 20:46:37 +00:00
Srujan Gaddam
03b9911a07 Make completeError be a proper JS function (#132492)
Function.toJS will start requiring that the function accept and return
JS types only.

Allows https://dart-review.googlesource.com/c/sdk/+/316867 to land.
2023-08-15 11:50:31 -07:00
Michael Goderbauer
32aa3128ee Analyze code snippets in flutter_driver docs (#132337) 2023-08-15 18:02:30 +00:00
Ian Hickson
cc0d63ea66 Further clarification of the TextSelectionControls migration (#132539)
Further follow-up for https://github.com/flutter/flutter/issues/122421.
2023-08-15 16:37:16 +00:00
Matan Lurey
6579844528 Update flutter_tools internals related to Gradle/XCode to set --local-engine-host. (#132346)
Partial work towards https://github.com/flutter/flutter/issues/132245.

I made a minor refactor to test-only code because it was too confusing
to have 2 optional parameters that are technically required together,
but otherwise all other changes *should* be pass throughs. That being
said, I can't say I totally understand the Gradle stuff so I could use a
hand double checking that.
2023-08-15 07:28:18 -07:00
Ian Hickson
ccdf826466 PaginatedDataTable improvements (#131374)
- slightly improved assert message when row cell counts don't match column count.
- more breadcrumbs in API documentation. more documentation in general.
- added more documentation for the direction of the "ascending" arrow.
- two samples for PaginatedDataTable.
- make PaginatedDataTable support hot reloading across changes to the number of columns.
- introduce matrix3MoreOrLessEquals. An earlier version of this PR used it in tests, but eventually it was not needed. The function seems useful to keep though.
2023-08-15 00:55:07 +00:00
pdblasi-google
e1ec3581bd Updates AutomatedTestWidgetsFlutterBinding.pump to support microsecond precision (#132401)
* Updated `AutomatedTestWidgetsFlutterBinding.pump` to use microseconds instead of milliseconds
* Added a test to prevent regression of the microsecond precision
* Fixed a test that incorrectly assumed millisecond precision

Closes #112610
2023-08-14 23:24:47 +00:00
Renzo Olivares
9a39a5d697 Selection area should move selection word by word on a long press drag (#132518)
On native iOS and Android when long pressing and then dragging the selection expands word by word. Before this change `SelectionArea` expanded the selection character by character on a long press drag.

Fixes #104603
2023-08-14 22:51:05 +00:00