23324 Commits

Author SHA1 Message Date
engine-flutter-autoroll
697d99fae8
Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (#149263)
Manual roll requested by jacksongardner@google.com

60968ee3bd...8d5d14a1db

2024-05-29 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 641d61332238 to ef405fbe3917 (12 revisions) (flutter/engine#53089)

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-30 00:53:23 +00:00
auto-submit[bot]
ebc414337d
Reverts "Prevent LayoutBuilder from rebuilding more than once (#147856)" (#149279)
Reverts: flutter/flutter#147856
Initiated by: loic-sharma
Reason for reverting: tree is closed with errors like: 

```
test/integration.shard/break_on_framework_exceptions_test.dart: breaks when rebuilding dirty elements throws [E]
  Expected: <45>
    Actual: <2756>
  
  package:matcher                                                       expect
  test\integration.shard\break_on_framework_exceptions_test.dart 56:5   main.expectException
  ===== asynchronous gap ===
Original PR Author: LongCatIsLooong

Reviewed By: {goderbauer}

This change reverts the following previous change:
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
2024-05-29 23:29:19 +00:00
Danny Tuppeny
182c1e6a36
Unskip expression evaluation test (#149253)
This test was skipped in https://github.com/flutter/flutter/pull/148737
because it had became flaky because instances created in expression
evaluation were being collected quickly. The change in
ffbbdb5a10
prevents things in the VM Service's ring buffer from being GC'd which
should resolve the issue.

I am unable to reproduce this test flaking locally on latest code.

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



## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] 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].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] 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-05-29 23:24:36 +01:00
Yegor
35543e9117
temporarily disable SemanticsAction tests to unblock engine change (#149274)
These tests essentially count the number of values in the engine enums. https://github.com/flutter/engine/pull/53094 is adding a new value, which causes these tests to fail. Temporarily disabling these tests so that the engine change can proceed.
2024-05-29 22:22:25 +00:00
LongCatIsLooong
bafdb124c7
Prevent LayoutBuilder from rebuilding more than once (#147856)
Fixes https://github.com/flutter/flutter/issues/146379: introduces `Element.buildScope` which `BuildOwner.buildScope` uses to identify subtrees that need skipping (those with different `BuildScope`s). If `Element.update` calls `updateChild` then dirty children will still be rebuilt regardless of their build scopes. 

This also introduces `LayoutBuilder.applyDoubleRebuildFix` migration flag which should only live for a week or less. 

Caveats: 

`LayoutBuilder`'s render object calls `markNeedsLayout` if a descendant Element is dirty. Since `markNeedsLayout` also implies `markNeedsPaint`, the render object is going to be very repaint/relayout-happy.

Tests: 

Presubmits with the migration flag set to true: https://github.com/flutter/flutter/pull/147856/checks?check_run_id=24629865893
2024-05-29 22:03:20 +00:00
Ellet
e553bbc2ba
Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS (#145246)
Since we are using The `CupertinoScrollBar` for both macOS and iOS, it's a good idea to update the description of the `adaptive` function to indicate it will be used for macOS and iOS

*Update progress_indicator.dart to indicate the adaptive option is for both macOS and iOS.*

![image](https://github.com/flutter/flutter/assets/73608287/51c21a43-ce64-4253-aff7-1854a7366eea)
2024-05-29 19:06:07 +00:00
LinXunFeng
d424b64229
_ModalScopeStatus as InheritedModel (#149022)
According to previous discussion at https://github.com/flutter/flutter/pull/145389#discussion_r1561564845, this change makes `_ModalScopeStatus` an `InheritedModel` rather than an `InheritedWidget`, and provides the following methods.

- `isCurrentOf`
- `canPopOf`
- `settingsOf`

For example, `ModalRoute.of(context)!.settings` could become `ModalRoute.settingsOf(context)` as a performance optimization.
2024-05-29 18:46:04 +00:00
LongCatIsLooong
557fca4582
Add a sentinel value for TextStyle.height (#149049)
Fixes: https://github.com/flutter/flutter/issues/58765

The rationale for the choice of the sentinel value: https://github.com/flutter/engine/pull/52940
The exact value of `kTextHeightNone` should be kept as an implementation detail. It's unfortunate that the current value `0` is dangerously close to `TextStyle.height`'s valid domain. If we ever allow `TextStyle.height == 0` (which totally makes sense) then it shouldn't be difficult to change the const.
2024-05-29 18:24:16 +00:00
Polina Cherkasova
c85fa6abf4
Clean leak in editable_text_test.dart. (#149223)
Introduced by https://github.com/flutter/flutter/pull/149042

<img width="145" alt="Screenshot 2024-05-28 at 6 25 22 PM" src="https://github.com/flutter/flutter/assets/12115586/5eb32012-b1c4-4188-8e9b-a6631483960c">
2024-05-29 15:41:18 +00:00
Hany Mohamed
9ea9726b21
Change snack bar default hitTestBehavior to deferToChild when SnackBarThemeData.insetPadding is not null (#148568)
The PR changes the default value of hitTestBehavior in snack bars to `HitTestBehavior.deferToChild` when snackBarTheme.insetPadding is not null, so that widgets behind snack bars affected by the value set to insetPadding, remain interactive even while a snack bar is visible. This PR can be considered as an extension to what have been done in PR #127959 which fixes the same problem but for individual snack bars with margin not being null. This PR works on the theme level.

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*
#148566
2024-05-29 04:31:32 +00:00
auto-submit[bot]
886de22182
Reverts "sliverGridDelegate mainAxisExtent add assert (#148470)" (#149224)
Reverts: flutter/flutter#148470
Initiated by: eyebrowsoffire
Reason for reverting: Unit test failures closing the tree.
Original PR Author: hello-coder-xu

Reviewed By: {QuncCccccc, Piinks}

This change reverts the following previous change:
* sliverGridDelegate mainAxisExtent add assert,Avoid incorrect use *

Fixes https://github.com/flutter/flutter/issues/138871
2024-05-29 02:33:16 +00:00
flyboy
af5a1a9e11
sliverGridDelegate mainAxisExtent add assert (#148470)
* sliverGridDelegate mainAxisExtent add assert,Avoid incorrect use *

Fixes https://github.com/flutter/flutter/issues/138871
2024-05-29 00:26:08 +00:00
Luis
b1540324e5
Fix SearchAnchor suggestions not refreshing after long API call (#148767)
Fixes https://github.com/flutter/flutter/issues/148765.

## Fix Demo
https://github.com/flutter/flutter/assets/28322469/ad76ac8b-5e84-4fee-b04c-fbc9fa919450
2024-05-29 00:20:18 +00:00
Loïc Sharma
1f4e378de1
Add link to golden file test docs in the framework gardener guide (#149207)
This also adds a link from the Framework gardener guide.
2024-05-28 23:55:58 +00:00
Polina Cherkasova
65e3007687
Remove opt out for CurvedAnimation. (#147594) 2024-05-28 16:35:29 -07:00
LongCatIsLooong
0214afb40b
Fix the RenderFlex.computeDryBaseline implementation to match computeDistanceToActualBaseline (#149062)
Per Hixie's comment [here](https://github.com/flutter/flutter/issues/145739#issuecomment-2128006146), keep the current behavior
2024-05-28 23:21:08 +00:00
Polina Cherkasova
c109b3cb02
Clean leaky test. (#149199)
Introduced by https://github.com/flutter/flutter/pull/149006

To repro run:

`flutter test /Users/polinach/_/flutter_dev/packages/flutter/test/material/text_button_test.dart --dart-define LEAK_TR`

<img width="268" alt="Screenshot 2024-05-28 at 11 50 33 AM" src="https://github.com/flutter/flutter/assets/12115586/c1a1bf5e-4df4-4819-b897-b09021d3a07a">
2024-05-28 23:06:10 +00:00
Gray Mackall
df64ca0b11
Change android_plugin_new_output_dir_test.dart test description (#149198)
Changes the test description to what I understand it is testing. 

Context at https://discord.com/channels/608014603317936148/846507907876257822/1245077048599515157.

cc @chunfengyao as the original author, as I see you are still active on Github 🙂
2024-05-28 23:04:10 +00:00
Bruno Leroux
fdca33c5b1
fix M2 InputDecorator suffix icon doesn't turn red on error (#149161)
The suffixIcon of a TextField with an error now turns red like it should (on Material 2).
2024-05-28 11:27:55 -07:00
Varun Kamani
e2e68c047c
Add selectionOverlayBuilder in CupertinoDatePicker and CupertinoTimer… (#143079)
It's now possible to override the default selection overlay with CupertinoDatePicker.selectionOverlayBuilder and CupertinoTimerPicker.selectionOverlayBuilder.
2024-05-28 11:24:57 -07:00
Justin McCandless
980b5a1976
Mouse onEnter and onExit now support hovering stylus (#149006)
Hovering with a stylus will now behave similarly to hovering with a mouse. For example, hovering a button will show the button's hovered styling.
2024-05-28 10:39:30 -07:00
LongCatIsLooong
b1221a92dc
Remove TextEditingController private member access (#149042)
Fixes https://github.com/flutter/flutter/issues/148692

I intend to CP this.
2024-05-28 17:37:25 +00:00
Kevin Moore
891432c30f
[tool] Use kebabCase directly (#149150)
Drop silly snakeCase(..., '-') bits
2024-05-28 15:33:15 +00:00
Martin Kustermann
9938ab1c60
[web] Remove --dart-sdk flag to dart2wasm compiler (#149129)
Dart2wasm only needs a platform file, which contains the compiled
`dart:*` libraries. There's no need to specify a seperate `--dart-sdk`
option (anymore).

(See also https://dart-review.googlesource.com/c/sdk/+/366821)
2024-05-28 09:48:44 +02:00
Bruno Leroux
0f3882e050
Fix Linux numpad shortcuts on web (#148988)
## Description

This PRs fixes a Web issue on Linux related to numpad keys.
In https://github.com/flutter/flutter/pull/145464, I introduced numpad shortcuts for Linux. These shortcuts work well on a desktop Linux application but they broke the Linux+Web numpad logic.

When I added these shortcuts, I expected them to not be active on Web (because I knew that on Web, those shortcuts are handled by the browser). But there is a trick: text editing shortcuts are still defined on Web but they are disabled at the editable text level so one can use them in components that are not `EditableText` (see https://github.com/flutter/flutter/pull/103377).
In this PR, I used the same approach than for other text editing shortcuts: when on web associate those shortcuts to the `DoNothingAndStopPropagationTextIntent` intent.

## Related Issue

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

## Tests

Updates 2 tests.
Adds 2 tests.
2024-05-25 19:59:19 +00:00
Joodo
734d243bc8
fix popup menu offset when using useRootNavigator in PopupMenu (#144670)
fix issue #144669
2024-05-24 21:38:08 +00:00
hangyu
8ff57091bc
[a11y] Slider should respect bold text setting (#149053)
Fix https://github.com/flutter/flutter/issues/147600

internal GAR issue: b/316933135

reopen from #148435
2024-05-24 19:48:14 +00:00
Łukasz Gawron
a53b78ddfb
Fix TwoDimensionalViewport's keep alive child not always removed (when no longer should be kept alive) (#148298)
- Fixes a child not removed from `_keepAliveBucket` when widget is no longer kept alive offscreen. Bug was triggering assert in performLayout.
- Adds test to cover the case from bug report

Fixes #138977
2024-05-24 16:26:07 +00:00
Nate
f419177057
Reland "Update FocusManager platform check to include iOS" (#148984)
It looks like removing `kIsWeb` from the `FocusManager._appLifecycleListener` platform check is causing [memory leaks](https://github.com/flutter/flutter/issues/148985) and test failures.

This pull request fixes #148475 and prevents the test failures shown in #148978.
2024-05-23 23:13:18 +00:00
Taha Tesser
ec69f001fc
Fix SnackBar action text button overlay color (#148961)
fixes [`SnackBar` action hover state background too hard to see](https://github.com/flutter/flutter/issues/141343)

### 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 const MaterialApp(
      home: Scaffold(
        body: Center(
          child: ScaffoldButton(),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return TextButton(
      onPressed: () {
        ScaffoldMessenger.of(context).showSnackBar(
          SnackBar(
            behavior: SnackBarBehavior.floating,
            width: 320,
            content: const Text('This is a snackbar!'),
            action: SnackBarAction(
              label: 'Close',
              onPressed: () {},
            ),
          ),
        );
      },
      child: const Text('Launch snackbar'),
    );
  }
}

```

</details>

### Before
<img src="https://github.com/flutter/flutter/assets/48603081/88b53c92-6184-4faf-88e1-ac70f78993b3"/> 

### After
 <img src="https://github.com/flutter/flutter/assets/48603081/3e03c903-90c0-4da4-b49a-0070208d56d1"  />
2024-05-23 22:42:52 +00:00
wangyognqi
881e29f94a
Fix the second TextFormField to trigger onTapOutside (#148930)
This PR attempts to fix https://github.com/flutter/flutter/issues/127597
2024-05-23 22:25:51 +00:00
Ian Hickson
2025ebe767
Remove hidden dependencies on HttpClient (#148773)
This is part 16 of a broken down version of the #140101 refactor.

This only makes one dependency explicit. Further PRs will do the same for other dependencies, until these APIs have no hidden dependencies.

This PR makes no effort to keep the order of parameters reasonable. There is an existing TODO to do a refactor sweep later that does nothing but reorder arguments/parameters/fields to be consistent.
2024-05-23 18:20:50 +00:00
Renzo Olivares
84fe3b6e53
Revert "Update FocusManager platform check to include iOS" (#148978) 2024-05-23 10:46:10 -07:00
Nate
8d955cdd64
Update FocusManager platform check to include iOS (#148612)
Both iOS and Android run into issues when the FocusManager starts responding to app lifecycle changes.

Fortunately, this feature is primarily meant for desktop platforms, so the problem can be resolved with a platform check.

fixes https://github.com/flutter/flutter/issues/148475
2024-05-23 16:40:45 +00:00
Matej Knopp
02d5286e02
[iOS] fix hot restart with native assets (#148752)
Fixes https://github.com/flutter/flutter/issues/148687

Adds support for running the hot restart and reload integration test on
iOS simulator.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] 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].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] 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-05-23 18:30:55 +02:00
LongCatIsLooong
a766945bdd
Allow RenderObject.getTransformTo to take an arbitrary RenderObject in the same tree (#148897)
This is https://github.com/flutter/flutter/pull/130192 but without the additional parameter.

Fixes https://github.com/flutter/flutter/issues/146764, https://github.com/flutter/flutter/issues/148410
2024-05-22 23:32:24 +00:00
Helin Shiah
edf312d506
Add frame number and widget location map service extension (#148702)
This helps us add widget rebuild counts to the DevTools performance page: https://github.com/flutter/devtools/issues/4564
2024-05-22 21:29:27 +00:00
LongCatIsLooong
d57ea48ca1
Remove an assert with false positives (#148795)
Fixes https://github.com/flutter/flutter/issues/110343.

This is not an important piece of guardrail and the iOS embedder only expects best-effort results anyways.
2024-05-22 21:25:31 +00:00
Renzo Olivares
b2eda0624a
Revert "Fix the second TextFormField to trigger onTapOutside" (#148909) 2024-05-22 13:40:59 -07:00
wangyognqi
9acbc1d4a2
Fix the second TextFormField to trigger onTapOutside (#148206)
This PR attempts to fix https://github.com/flutter/flutter/issues/127597
2024-05-22 18:33:14 +00:00
Gray Mackall
eba7b97bb9
Try removing robolectric from integration_test tests (#148803)
May fix https://github.com/flutter/flutter/issues/148393.

There are reports on the robolectric issue tracker of >`4.10.3` causing the error we are seeing
https://github.com/robolectric/robolectric/issues/8158
The test doesn't actually need robolectric (and didn't originally use it, or flake before using it), but it was added in https://github.com/flutter/flutter/pull/144348. We can safely remove it by mocking the call to `View.generateViewId()`, so try removing it and see if flakes go away.
2024-05-22 18:29:19 +00:00
Victor Eronmosele
4c929f0f44
Prevent test folder deletion on running flutter create --empty on an existing app project (#147160)
This PR modifies the `flutter create --empty` command to not delete the `test/` folder when run on an existing app project. 

Before:
```bash
flutter create my_app --empty
mkdir my_app/test
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
flutter create my_app --empty  
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test does not exist
```

After:
```bash
flutter create my_app --empty
mkdir my_app/test
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
flutter create my_app --empty  
if test -d my_app/test; then echo "test exists"; else echo "test does not exist"; fi # test exists
```
Fixes https://github.com/flutter/flutter/issues/134928
2024-05-22 17:37:05 +00:00
Daco Harkes
1f16d9121c
[native_assets] Add support for link hooks (#148474)
This PR adds support invoking `link.dart` hooks.

Link hooks can add new assets. Link hooks can transform assets sent to link hook from build hooks.

This PR does not yet add support for getting tree-shake information in the link hooks. This is pending on defining the `resources.json` format (https://github.com/dart-lang/sdk/issues/55494).

Issue:

* https://github.com/flutter/flutter/issues/146263

## Implementation considerations

The build hooks could be run before Dart compilation and the link hooks after Dart compilation. (This is how it's done in Dart standalone.) However, due to the way the `Target`s are set up, this would require two targets and serializing and deserializing the `BuildResult` in between these. This would lead to more code but no benefits. Currently there is nothing that mandates running build hooks before Dart compilation.

## Testing

* The unit tests verify that the native_assets_builder `link` and `linkDryRun` would be invoked with help of the existing fake.
* The native assets integration test now also invokes an FFI call of a package that adds the asset during the link hook instead of the build hook.
  * In order to keep coverage of the `flutter create --template=package_ffi`, `flutter create` is still run and the extra dependency is added and an extra ffi call is added. (Open to alternative suggestions.)
2024-05-22 16:02:00 +00:00
Dimil Kalathiya
73bf206f35
CupertinoDialogRoute leak fix (#148774) 2024-05-22 07:43:33 -07:00
Taha Tesser
ea7cf54b42
Introduce WidgetStateBorderSide.lerp (#148122)
fixes [Consolidate `_LerpSides` classes with `WigetStateProperty<BorderSide?>` type  into a new `WidgetStateBorderSide.lerp`](https://github.com/flutter/flutter/issues/148057)
2024-05-22 07:11:07 +00:00
holzgeist
43548359c9
add default-flavor field to flutter pubspec, which will be used as the flavor in flutter build/run if --flavor is not provided (#147968)
This PR adds a new flag `default-flavor` in the `flutter` section of `pubspec.yaml`. It allows developers of multi-flavor android apps to specify a default flavor to be used for `flutter run`, `flutter build` etc.
Using `flutter run` on flavored apps already works without specifying `--flavor` already works on iOS (it defaults to the `runner` schema), so I (and others in #22856) figured this would be nice to have.

fixes #22856
2024-05-22 05:11:24 +00:00
Victor Sanni
81f962de40
Make hover tests functional and cleanup mouse pointers in Material toggleables (#148808)
Tests in Material toggleables (`Radio`, `Switch`, `Checkbox`) which require hovering using a mouse pointer do not include `addTearDown(gesture.removePointer)` to remove the mouse pointer once the test concludes.

Also, hovering tests in Material `Checkbox` currently have no functionality (i.e what is painted before hovering = what is painted while hovering). For example:

357bd65749/packages/flutter/test/material/checkbox_test.dart (L880-L896)

This PR adds `addTearDown(gesture.removePointer)` to `Radio`, `Switch`, and `Checkbox` tests, and functionality for `Checkbox` hover tests.

Fixes #148809.
2024-05-22 04:58:01 +00:00
Amir Panahandeh
7d529a7521
Fix two dimensional viewport unexpected null exception when no child is laid out (#148256)
- Fixes #148255
2024-05-21 22:54:34 +00:00
Polina Cherkasova
87aa8423a2
Fix test that leaks images. (#148494)
Contributes to https://github.com/flutter/flutter/issues/145599

Repro:
`flutter test test/cupertino/tab_scaffold_test.dart  --dart-define LEAK_TRACKING=true --plain-name "Adding new tabs does not crash the app"`

What is going on: 
1. ImageCache.putIfAbsent, in case the image already existed in the cache, invokes ImageCache._trackLiveImage, that creates _LiveImage and passes the image's completer as parameter `completer`
3. _LiveImage constructor invokes super constructor (of _CachedImageBase) that initializes the member `handle`
4. `handle` is disposed [using scheduler](c698e694c8/packages/flutter/lib/src/painting/image_cache.dart (L633)), and disposal does not happen in time of test completion.

Adding delay to the test increases number of not disposed objects from 30 to 120.
Should we force schedule at the end of the widget tests somehow to make scheduler switched to right state?

Creation call stack:

```
#9______new_ImageStreamCompleterHandle.__(package:flutter/src/painting/image_stream.dart:465:41)
#10_____ImageStreamCompleter.keepAlive_(package:flutter/src/painting/image_stream.dart:655:39)
#11_____new__CachedImageBase_(package:flutter/src/painting/image_cache.dart:609:27)
#12_____new__LiveImage_(package:flutter/src/painting/image_cache.dart:647:9)
#13_____ImageCache._trackLiveImage.<anonymous_closure>_(package:flutter/src/painting/image_cache.dart:302:14)
#14______LinkedHashMapMixin.putIfAbsent_(dart:collection-patch/compact_hash.dart:543:23)
#15_____ImageCache._trackLiveImage_(package:flutter/src/painting/image_cache.dart:296:17)
#16_____ImageCache.putIfAbsent_(package:flutter/src/painting/image_cache.dart:378:7)
#17_____ImageProvider.resolveStreamForKey_(package:flutter/src/painting/image_provider.dart:517:81)
                      #18_____ScrollAwareImageProvider.resolveStreamForKey_(package:flutter/src/widgets/scroll_aware_image_provider.dart:104:19)
#19_____ImageProvider.resolve.<anonymous_closure>_(package:flutter/src/painting/image_provider.dart:366:9)
#20_____ImageProvider._createErrorHandlerAndKey.<anonymous_closure>_(package:flutter/src/painting/image_provider.dart:479:24)
#21_____SynchronousFuture.then_(package:flutter/src/foundation/synchronous_future.dart:43:39)
                      #22_____ImageProvider._createErrorHandlerAndKey_(package:flutter/src/painting/image_provider.dart:476:9)
#23_____ImageProvider.resolve_(package:flutter/src/painting/image_provider.dart:363:5)
#24______ImageState._resolveImage_(package:flutter/src/widgets/image.dart:1111:16)
#25______ImageState.didChangeDependencies_(package:flutter/src/widgets/image.dart:1061:5)
#26_____StatefulElement._firstBuild_(package:flutter/src/widgets/framework.dart:5630:11)
#27_____ComponentElement.mount_(package:flutter/src/widgets/framework.dart:5457:5)
#28_____Element.inflateWidget_(package:flutter/src/widgets/framework.dart:4334:16)
#29_____Element.updateChild_(package:flutter/src/widgets/framework.dart:3843:18)
#30_____SingleChildRenderObjectElement.mount_(package:flutter/src/widgets/framework.dart:6763:14)
```
2024-05-21 21:33:20 +00:00
Gray Mackall
24979ab2c5
Fix warnings in dependency_version_checker.gradle.kts (#148699)
Newer Gradle/AGP versions include the following warnings:
```
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:107:40: Variable 'agpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:108:40: Variable 'kgpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:143:28: Parameter 'project' is never used
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:152:40: Variable 'agpVersion' initializer is redundant
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:167:55: 'Version' is deprecated. Deprecated in Java
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:195:56: Unnecessary non-null assertion (!!) on a non-null receiver of type Any
w: file:///Users/goderbauer/dev/flutter/packages/flutter_tools/gradle/src/main/kotlin/dependency_version_checker.gradle.kts:344:28: The corresponding parameter in the supertype 'Comparable' is named 'other'. This may cause problems when calling this function with named arguments.
```

These also get printed out to the CLI, so they are somewhat annoying.

Fixes all of the warnings, except for `'Version' is deprecated. Deprecated in Java`, which gets suppressed (we are intentionally using the deprecated `Version`, to help support older versions of AGP that use that deprecated class).
2024-05-21 20:56:50 +00:00