Commit graph

23093 commits

Author SHA1 Message Date
godofredoc 1ca88730a0
Update integration tests regexes. (#144847)
Some tests are assuming the flutter sdk code is being checked out to flutter and checking the code to a different repository makes them fail.

Bug: https://github.com/flutter/flutter/issues/144487
2024-03-12 01:31:25 +00:00
auto-submit[bot] 49f45d2095
Reverts "Fail tests on exceptions raised after test completed (#144706)" (#144970)
Reverts: flutter/flutter#144706
Initiated by: gspencergoog
Reason for reverting: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing.
Original PR Author: goderbauer

Reviewed By: {Piinks}

This change reverts the following previous change:
A test was failing silently because of this (see https://github.com/flutter/flutter/issues/144353 and fixed in https://github.com/flutter/flutter/pull/144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
2024-03-11 23:31:18 +00:00
Polina Cherkasova e66811ae04
Make TabController communicating creation in constructor. (#144912)
Contributes to https://github.com/flutter/flutter/issues/144910
2024-03-11 23:13:47 +00:00
Michael Goderbauer 91cccc8e6b
Fail tests on exceptions raised after test completed (#144706)
A test was failing silently because of this (see
https://github.com/flutter/flutter/issues/144353 and fixed in
https://github.com/flutter/flutter/pull/144709). The failure went
undetected for months. Ideally, this should have been a regular
non-silent failure. This change makes that so. `package:test` can
properly handle reported exceptions outside of test cases. With this
change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
2024-03-11 16:05:24 -07:00
Nate 26e379e0fc
Refactoring if chains into switch statements (#144905)
Based on issue #144903, this PR aims to bring the codebase more in line with the [Flutter repo style guide](https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#avoid-using-if-chains-or--or--with-enum-values):

> #### Avoid using `if` chains or `?:` or `==` with enum values

<br>

This change unfortunately increases the total line length, but it also improves readability.
2024-03-11 23:04:57 +00:00
auto-submit[bot] 187ec75eb5
Reverts "Expose build mode in environment of asset transformer processes (#144752)" (#144957)
Reverts: flutter/flutter#144752
Initiated by: andrewkolos
Reason for reverting: compilation issue has turned the tree red
Original PR Author: andrewkolos

Reviewed By: {christopherfujino}

This change reverts the following previous change:
In service of https://github.com/flutter/flutter/issues/143348

When invoking a package to transform an asset, we set `FLUTTER_BUILD_MODE` to the CLI name of the build mode being used. Inspired by https://github.com/flutter/flutter/issues/101077#issuecomment-1890379501:

> Do transformers know whether they get executed in debug or release mode? I kinda imagine that being useful. Ex: There's a transformer that optimizes the file size of images. Depending on the amount and size of the images, that could take a significant amount of time. Therefore, I might want to only execute it in release builds.

Note for the reviewer: the interesting part of this change can be found in the commit [set environment variable to build mode when running asset transformer…](579912d470). The rest of the change is updating call sites with a new argument.
2024-03-11 21:00:17 +00:00
Andrew Kolos 83fad74535
Expose build mode in environment of asset transformer processes (#144752)
In service of https://github.com/flutter/flutter/issues/143348

When invoking a package to transform an asset, we set `FLUTTER_BUILD_MODE` to the CLI name of the build mode being used. Inspired by https://github.com/flutter/flutter/issues/101077#issuecomment-1890379501:

> Do transformers know whether they get executed in debug or release mode? I kinda imagine that being useful. Ex: There's a transformer that optimizes the file size of images. Depending on the amount and size of the images, that could take a significant amount of time. Therefore, I might want to only execute it in release builds.

Note for the reviewer: the interesting part of this change can be found in the commit [set environment variable to build mode when running asset transformer…](579912d470). The rest of the change is updating call sites with a new argument.
2024-03-11 20:39:31 +00:00
victorgalo b9afa60fdd
Skip test temporarily until headingLevel is added in engine (issue 41… (#135077)
The purpose of this PR is to temporarily skip one integration test that is blocking the changes indicated below:

(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:
https://github.com/flutter/flutter/issues/97894

Engine part:
https://github.com/flutter/engine/pull/41435 

Framework part:
https://github.com/flutter/flutter/pull/125771
2024-03-11 16:31:21 +00:00
Ian Hickson dbcce277f3
Rename isAvailableForEnvironment to isForEnvironment (#143176) (#144858)
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)

----

This is a reland of https://github.com/flutter/flutter/pull/143176 which was speculatively reverted in https://github.com/flutter/flutter/pull/144855 but turned out not to be the cause of the tree redness.
2024-03-10 06:20:38 +00:00
yim f733e3a441
Fix multiple calls to Slider's onChanged. (#143680)
Fixes #143524
2024-03-09 07:50:23 +00:00
Polina Cherkasova a04fe3169a
Upgrade vm_service. (#144845) 2024-03-08 17:09:07 -08:00
Percival cab4a0fb88
Replace dead links (#144827)
I have found that some Apple-related links are no longer accessible, and they have been replaced
2024-03-09 01:08:06 +00:00
auto-submit[bot] 0432a6941d
Reverts "Rename isAvailableForEnvironment to isForEnvironment (#143176)" (#144855)
Reverts: flutter/flutter#143176
Initiated by: QuncCccccc
Reason for reverting: made tree red.
Original PR Author: Hixie

Reviewed By: {Piinks}

This change reverts the following previous change:
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)
2024-03-08 23:19:15 +00:00
Ian Hickson 5bd34ef541
Rename isAvailableForEnvironment to isForEnvironment (#143176)
This is part 4 of a broken down version of the #140101 refactor.

This PR renames isAvailableForEnvironment to isForEnvironment and replaces a regular expression with a simple function. (The latter will change the behaviour for people with branch names like `mainly_refactors` or `chess_master_experiment` or whatever, but I'm pretty sure the old behaviour was not intended.)
2024-03-08 20:20:13 +00:00
Mitchell Goodwin 2be5084b26
Fixes the transition builder changing the Cupertino transition on Android. (#134790)
Fixes #124850.

Changes the fallback for the builder on Android. Before the error was from the platform being changed mid Cupertino transition to iOS. If a default builder wasn't set for iOS (which a developer developing only for Android might not), then it defaulted to the Zoom transition. Which changing the transition while on the fly caused issues.
2024-03-08 19:00:16 +00:00
Jackson Gardner 074114b85a
Copy over source maps from dart2js target when they are enabled. (#144832)
This fixes https://github.com/flutter/flutter/issues/143703

We need to make sure that when source maps are enabled for the dart2js target, it advertises the sourcemap file as one of its outputs so that the web release bundle can copy it over.
2024-03-08 18:56:18 +00:00
Martin Kustermann 7c89ec8bbc
Remove toString() overrides in dart:ui/package:flutter in profile/release mode on wasm/vm targets (#144763)
The flutter engine & framework can opt out of this optimization for
individual classes / class hierarchies via:

  * `@pragma(flutter:keep-to-string)`
  * `@pragma(flutter:keep-to-string-in-subtypes)`

Or by using the convenience constant `@keepToString` from `dart:ui`.

=> This aligns the build process more with g3 (which already does this)

Closes https://github.com/flutter/flutter/issues/52759
2024-03-08 09:55:02 +01:00
Loïc de Porcaro dde616dbe1
Update documentation of AlertDialog's default TextStyle for Material 3 (#144697)
## Update `AlertDialog` Documentation for Material 3 Defaults

This pull request updates the documentation for `AlertDialog` to accurately reflect the default text styles (`titleTextStyle` and `contentTextStyle`) when using Material 3.
Previously, the documentation suggested default styles (`TextTheme.titleLarge` for titles and `TextTheme.titleMedium` for content) that do not align with Material 3 implementation, which uses `TextTheme.headlineSmall` and `TextTheme.bodyMedium` respectively.

Fixes #144489
2024-03-08 00:21:35 +00:00
Andrew Kolos 06ac042271
Enable asset transformation for flutter run -d <browser> and flutter test (#144734)
Partial implementation of https://github.com/flutter/flutter/issues/143348.

The title says it all. Feel free to experiment with the feature using this project: https://github.com/andrewkolos/asset_transformers_test.
2024-03-07 23:38:40 +00:00
August dc6f94a878
refactor: Remove throwOnPluginPubspecError flag for plugin validation (#144214)
Part of #137040 and #80374

The flag `throwOnPluginPubspecError` never actually was enabled during production in #79669, but only in some dart plugin tests. And in the tests the case of the error when enabling the flag was not explicitly tested. The only thing tested was, that it is not thrown when disabled.

As explained [here](https://github.com/flutter/flutter/pull/142035#discussion_r1484237904) the only case, where this error could be thrown is, when a dart implementation and a native inline implementation are provided simultaneously. But throwing an exception there is a wrong behavior, as both can coexist in a plugin package, thus in the pubspec file.

Disabling the flag means, that the error is not thrown and not shown to the user. This is the case in production (contrary to the dart plugin tests), which acts like these plugin cases of implementations are just skipped. And this is what actually should be done.

In conclusion, I think the case of coexisting dart and native implementation in pubspec was just overlooked and therefore this error validation was introduced, which is not necessary or even valid.

For more discussion, see: https://discord.com/channels/608014603317936148/608022056616853515/1200194937791205436

  - This is tricky: I already added a test in #142035, which finally complies with the other tests, by removing the flag. So I think it falls in the category of "remove dead code".
  - Theoretically this is a breaking change, as removing / altering some tests. But the flag actually was never valid or used, so IDK. But this may not does fall in the category of "contributed tests".
2024-03-07 23:04:08 +00:00
Faisal Ansari 874804e511
Fixed -> DropdownMenu throws exception when it is in any scrollable l… (#140566)
Fixed -> DropdownMenu throws exception when it is in any scrollable list view and scrolls quickly #139871
2024-03-07 20:46:03 +00:00
Christopher Fujino 2dd06d10c9
[flutter_tools] add custom tool analysis to analyze.dart, lint Future.catchError (#140122)
Ensure tool code does not use Future.catchError or Future.onError, because it is not statically safe: https://github.com/dart-lang/sdk/issues/51248.

This was proposed upstream in dart-lang/linter in https://github.com/dart-lang/linter/issues/4071 and https://github.com/dart-lang/linter/pull/4068, but not accepted.
2024-03-07 18:10:07 +00:00
Bruno Leroux 471a82856d
[flutter_test] Use defaultTargetPlatform for key events simulation (#143579)
## Description

This PRs changes the default value for the `platform` parameter used to simulate key events.

With this PR, the default value is "web" on web, otherwise it is the operating system name retrieved from `defaultTargetPlatform`.

Previously, for methods in `WidgetController`, it defaulted to “web” on web, and “android” everywhere else. And for methods in `KeyEventSimulator` it defaulted to “web” on web, and the operating system that the test was running on everywhere else. Because the operating system was based on `Platform.operatingSystem`, it usually differed from the target platform the test was running on.

AFAIK, the `platform` parameter is only meaningful for simulating `RawKeyEvent`. Once `RawKeyboard` will be fully removed, the `platform` parameter won’t be needed. 
@gspencergoog  In the meantime, do you think it is worth merging this fix?

## Related Issue

Fixes to https://github.com/flutter/flutter/issues/133955

## Tests

Adds one test.
2024-03-07 16:08:20 +00:00
Matej Knopp de72832079
Fix frameworks added to bundle multiple times instead of lipo (#144688)
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-03-07 15:09:15 +00:00
Bruno Leroux 8ade81fb20
[flutter_test] Change KeyEventSimulator default transit mode (#143847)
## Description

This PRs changes the default value transit mode for key event simulation.

The default transit mode for key event simulation is currently `KeyDataTransitMode.rawKeyData` while on the framework side `KeyDataTransitMode.keyDataThenRawKeyData` is the preferred transit mode.

`KeyDataTransitMode.keyDataThenRawKeyData` is more accurate and can help detect issues.

For instance the following test will fail with `KeyDataTransitMode.rawKeyData` because raw keyboard logic for modifier keys is less accurate:

```dart
  testWidgets('Press control left once', (WidgetTester tester) async {
    debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.keyDataThenRawKeyData;

    final List<KeyEvent> events = <KeyEvent>[];
    final FocusNode focusNode = FocusNode();
    addTearDown(focusNode.dispose);

    await tester.pumpWidget(
      Focus(
        focusNode: focusNode,
        autofocus: true,
        onKeyEvent: (_, KeyEvent event) {
          events.add(event);
          return KeyEventResult.handled;
        },
        child: Container(),
      ),
    );

    await simulateKeyDownEvent(LogicalKeyboardKey.controlLeft);

    // This will fail when transit mode is KeyDataTransitMode.rawKeyData
    // because a down event for controlRight is synthesized.
    expect(events.length, 1);

    debugKeyEventSimulatorTransitModeOverride = null;
  });
```

And the following this test is ok with `KeyDataTransitMode.rawKeyData` but rightly fails with `KeyDataTransitMode.keyDataThenRawKeyData`:

```dart
  testWidgets('Simulates consecutive key down events', (WidgetTester tester) async {
    debugKeyEventSimulatorTransitModeOverride = KeyDataTransitMode.rawKeyData;

    // Simulating several key down events without key up in between is tolerated
    // when transit mode is KeyDataTransitMode.rawKeyData, it will trigger an
    // assert on KeyDataTransitMode.keyDataThenRawKeyData.
    await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);
    await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown);

    debugKeyEventSimulatorTransitModeOverride = null;
  });
```

## Related Issue

Related to https://github.com/flutter/flutter/issues/143845

## Tests

Adds two tests.
2024-03-07 07:19:26 +00:00
Valentin Vignal 96dd1984ec
Fix memory leak in editable_gesture_test.dart (#144691) 2024-03-06 17:51:54 -08:00
Martin Kustermann aba7bc3f42
Use wasm-compatible conditional import in timeline.dart, avoid emitting timeline events in SchedulerBinding (#144682) 2024-03-06 23:08:24 +01:00
Qun Cheng f38c5ad441
Remove deprecated errorColor from ThemeData (#144078)
This PR is to remove deprecated `ThemeData.errorColor`.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/110162.
Part of https://github.com/flutter/flutter/issues/143956
2024-03-06 20:41:04 +00:00
Andrew Kolos cc33f44e41
make DevFSContent descendants immutable (#144664)
`DevFSBytesContent` (and it's descendant `DevFSStringContent`) have setters that change the underlying content. These are unused outside of tests, so this PR removes them. Amongst other things, this could help me refactor https://github.com/flutter/flutter/pull/144660 into something that has fewer pitfalls.

This is purely a refactoring.
2024-03-06 20:21:41 +00:00
Jonah Williams 2ebd7f0d55
[Impeller] measure GPU memory usage. (#144575)
Framework side to https://github.com/flutter/engine/pull/51187

Part of https://github.com/flutter/flutter/issues/144617
2024-03-06 20:17:31 +00:00
Gray Mackall 9973771cc3
Update android templates to use target sdk 34 (#144641)
We should always target the newest, and 34 is the newest. This isn't a requirement yet (like it is for 33+) but presumably it will be made required in the nearish future.
2024-03-06 19:15:07 +00:00
Greg Price 6b9d3ea4fc
Fill in SliverConstraints fields missing from ==, hashCode, toString (#143661)
I was doing some debugging on a RenderSliver subclass, and found
that SliverConstraints.toString was missing the precedingScrollExtent
field.

Add that, and add both that field and userScrollDirection to the
`==` and hashCode implementations, which had been skipping them,
so that all three methods now handle all the class's fields.
2024-03-06 03:23:18 +00:00
Victoria Ashworth 7e05bc4b30
Fix embedding FlutterMacOS.framework for macOS add2app via cocoapods (#144248)
Fixes https://github.com/flutter/flutter/issues/144244.
2024-03-05 21:59:49 +00:00
Andrew Kolos ff3b6dc02c
Enable asset transformation feature in hot reload workflow (excluding Web) (#144161)
Partial implementation of https://github.com/flutter/flutter/issues/143348

This enables asset transformation during hot reload (except for web, because that has its own implementation of `DevFS` 🙃). Asset transformers will be reapplied after changing any asset and performing a hot reload during `flutter run`.
2024-03-05 21:54:06 +00:00
Tirth 311c0064d8
Adds missing style to PopupMenuButton (#143392)
Adds missing `style` to `PopupMenuButton`.

Fixes: #114709
2024-03-05 19:42:30 +00:00
Michael Goderbauer 2aa1efcf0a
Add regression test for TabBar crash (#144627)
This is a regression test for https://github.com/flutter/flutter/issues/144087 and https://github.com/flutter/flutter/issues/138588.

To be submitted after https://github.com/flutter/flutter/pull/144579.
2024-03-05 19:24:05 +00:00
Andrew Kolos 4e6de2be33
remove unused firstBuildTime parameter in DevFS::update (#144576)
The title says it all. This parameter is unused and serves no apparent purpose.
2024-03-05 19:14:48 +00:00
Michael Goderbauer d93f24ab93
Revert "_DefaultTabControllerState should dispose all created TabContoller instances. (#136608)" (#144579)
This reverts commit 9fa9fd365c.

Fixes https://github.com/flutter/flutter/issues/144087.
Fixes https://github.com/flutter/flutter/issues/138588.

This crash has been reported previously from a customer in google3 in https://github.com/flutter/flutter/issues/138588, but we weren't able to track it down. Thankfully, a repro was now provided in https://github.com/flutter/flutter/issues/144087#issuecomment-1968257383 which traced the crash down to a change made in #136608. This PR reverts that change to fix that crash for now. I will post a new PR shortly that will add a test to cover the use case that caused the crash with #136608 to make sure we don't re-introduce the crash in the future.
2024-03-05 18:41:56 +00:00
Matej Knopp df2b360453
Do not shorten native assets framework names (#144568)
Previously the name was shortened to 15 characters, which doesn't seem
to be necessary.
[CFBundleName](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundlename)
documentation mentions 15 character length, but that does not seem to be
relevant to framework bundles.

Flutter plugins already have framework bundles with names longer than 15
characters and it is not causing any issues.

## 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 `///`).
- [x] 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-03-05 14:58:15 +01:00
Bruno Leroux 67e6cad0cb
Restorable CupertinoTextFormFieldRow (#144541)
## Description

This PR makes `CupertinoTextFormFieldRow` restorable.
The implementation is based on https://github.com/flutter/flutter/pull/78835 which made `FormField` and `TextFormField` restorable.

## Related Issue

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

## Tests

Adds 4 tests.
2024-03-05 10:31:04 +00:00
Jonah Williams 89b5f3a717
Disable super flakey impeller test. (#144573)
Until we figure out why this is unstable on Impeller swiftshader, disable it.
2024-03-05 00:16:21 +00:00
Jenn Magder 9b442b2749
Print warning and exit when iOS device is unpaired (#144551)
Explicitly handle the case where the iOS device is not paired.  On `flutter run` show an error and bail instead of trying and failing to launch on the device.

On this PR:
```
$ flutter run -d 00008110-0009588C2651401E
'iPhone' is not paired. Open Xcode and trust this computer when prompted.
$
```

Fixes https://github.com/flutter/flutter/issues/144447
Closes https://github.com/flutter/flutter/pull/144095
2024-03-04 23:01:11 +00:00
LongCatIsLooong de0ccf39c6
Remove unnecessary (and the only) RenderObject.markParentNeedsLayout override (#144466)
Nobody calls it except for `markNeedsLayout`, and the render object is a guaranteed relayout boundary.
2024-03-04 21:58:17 +00:00
Bruno Leroux 16d122dbe2
Fix text color for default CupertinoContextMenuAction (#144542)
## Description

This PR fix the text color for the default action in a CupertiniContextMenu.
Previously the dynamic color was not resolved which leads to text being blacks when theme brightness was dark.

| Before | After |
|--------|--------|
| ![Capture d’écran 2024-03-04 à 14 58 45](https://github.com/flutter/flutter/assets/840911/6a06715d-b2b8-49e1-b6de-37c03b96b627) |  ![Capture d’écran 2024-03-04 à 15 00 27](https://github.com/flutter/flutter/assets/840911/ed7c71ec-96f2-46ca-a5f6-ba3890732e33) |

## Related Issue

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

## Tests

Adds 1 test, updates 1.
2024-03-04 21:36:03 +00:00
Nate 1a0dc8f1e1
Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279)
Originally, my aim was just to refactor (as per usual), but while messing around with the `TableBorder.symmetric` constructor, I realized that `borderRadius` was missing!

This pull request makes a few class constructors more efficient, and it fixes #144277 by adding the missing parameter.

<br>
2024-03-04 20:20:19 +00:00
Matej Knopp 1d7f4a9afa
Fix build mode not propagated in android native asset build (#144550)
This fixes bug where build mode is hardcoded to debug while building
native assets for Android.

## 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 `///`).
- [x] 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-03-04 21:11:14 +01:00
Qun Cheng 7c50267fa0
Doc fix for DropdownButtonFormField.value (#144427)
Fixes https://github.com/flutter/flutter/issues/144135

This PR is just a doc fix.
2024-03-04 18:52:20 +00:00
Tirth 35863b753f
Fix Small Typo in Skia_Client Doc Comment (#144490)
Fix Small Typo in Skia_Client Doc Comment.
2024-03-04 18:24:13 +00:00
Loïc Sharma cc740eb503
[Windows] Update keyboard modifiers link (#144426)
Updates link to the new location. No tests as this only changes a comment.
2024-03-04 17:13:49 +00:00
Taha Tesser 9a838455e2
Fix showDateRangePicker is missing dartpad tag and cleanup (#144475)
fixes [`showDateRangePicker` interactive sample not loading](https://github.com/flutter/flutter/issues/144474)

### Description 

This fixes `showDateRangePicker` example not loading in Dartpad.

Similar fix was made for `showDatePicker` in https://github.com/flutter/flutter/pull/99401
2024-03-01 15:36:24 +00:00
Taha Tesser ba719bc588
Fix CalendarDatePicker day selection shape and overlay (#144317)
fixes [`DatePickerDialog` date entry hover background and ink splash have different radius](https://github.com/flutter/flutter/issues/141350)
fixes [Ability to customize DatePicker day selection background and overlay shape](https://github.com/flutter/flutter/issues/144220)

### Code sample

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

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Builder(builder: (context) {
            return FilledButton(
              onPressed: () {
                showDatePicker(
                  context: context,
                  initialDate: DateTime.now(),
                  firstDate: DateTime.utc(2010),
                  lastDate: DateTime.utc(2030),
                );
              },
              child: const Text('Show Date picker'),
            );
          }),
        ),
      ),
    );
  }
}
```

</details>

### Material DatePicker states specs

![overlay_specs](https://github.com/flutter/flutter/assets/48603081/45ce16cf-7ee9-41e1-a4fa-327de07b78d1)

### Day selection overlay

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/b529d38d-0232-494b-8bf2-55d28420a245" /> | <img src="https://github.com/flutter/flutter/assets/48603081/c4799559-a7ef-45fd-aed9-aeb386370580"  /> |

### Hover, pressed, highlight preview

| Before | After |
| --------------- | --------------- |
| <video src="https://github.com/flutter/flutter/assets/48603081/8edde82a-7f39-4482-afab-183e1bce5991" /> | <video src="https://github.com/flutter/flutter/assets/48603081/04e1502e-67a4-4b33-973d-463067d70151" /> |

### Using `DatePickerThemeData.dayShape` to customize day selection background and overlay shape

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/a0c85f58-a69b-4e14-a45d-41e580ceedce"  />  | <img src="https://github.com/flutter/flutter/assets/48603081/db67cee1-d28d-4168-98b8-fd7a9cb70cda" /> | 

### Example preview

![Screenshot 2024-02-29 at 15 07 50](https://github.com/flutter/flutter/assets/48603081/3770ed5c-28bf-4d0a-9514-87e1cd2ce515)
2024-03-01 12:44:29 +00:00
Taha Tesser cfabdca9ca
Fix chips use square delete button InkWell shape instead of circular (#144319)
fixes [Chips delete button hover style is square, not circular](https://github.com/flutter/flutter/issues/141335)

### Code sample

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

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: RawChip(
            label: const Text('Test'),
            onPressed: null,
            deleteIcon: const Icon(Icons.clear, size: 18),
            onDeleted: () {},
          ),
        ),
      ),
    );
  }
}
```

</details>

### Preview

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/c5d62c57-97b3-4f94-b83d-df13559ee3a8" /> | <img src="https://github.com/flutter/flutter/assets/48603081/b76edaab-73e0-4aa9-8ca2-127eedd77814"  /> |
2024-03-01 12:02:07 +00:00
Bruno Leroux e8f8a8dc17
InputDecorator M3 tests migration - Step4 - Hint tests (#144169)
## Description

This PR migrate hint related tests to M3 and adds some missing tests.

It is the fourth step for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369
Step 3: https://github.com/flutter/flutter/pull/143520

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076
2024-03-01 10:04:14 +00:00
Bruno Leroux 8a312cd01a
Horizontally expand text selection toolbar buttons in overflow menu (#144391)
## Description

This PR expands the items displayed in the overflow menu of a `TextSelectionToolbar` making buttons clickable in the blank area.

| Before | After |
|--------|--------|
| Each item has its own width | All items expand horizontally |
|  ![Capture d’écran 2024-02-29 à 14 43 57](https://github.com/flutter/flutter/assets/840911/f7379eef-9185-4cc4-bf14-e4c916c432b1) | ![Capture d’écran 2024-02-29 à 14 40 47](https://github.com/flutter/flutter/assets/840911/bff272cd-9fe2-4f07-adaf-61edef03d26e) | 

## Related Issue

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

## Tests

Adds 1 tests.
2024-03-01 06:40:47 +00:00
Michael Goderbauer 52bb198fb2
Remove master from API docs (#144425) 2024-03-01 01:06:56 +00:00
hangyu 14b914ab92
Reland [a11y] Fix date picker cannot focus on the edit field (#144198)
reland https://github.com/flutter/flutter/pull/143117 


fixes: https://github.com/flutter/flutter/issues/143116
fixes: https://github.com/flutter/flutter/issues/141992

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-02-29 15:16:53 -08:00
Lau Ching Jun f3ce9d2fcb
Make daemon server work on ipv6-only machines. (#144359)
Retry binding on ipv6 if binding on ipv4 failed.
2024-02-29 23:10:50 +00:00
Qun Cheng ee6111a7aa
Remove deprecated backgroundColor from ThemeData (#144079)
This PR is to remove deprecated ThemeData.backgroundColor.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/110162.
Part of https://github.com/flutter/flutter/issues/143956
2024-02-29 23:07:23 +00:00
Amir Panahandeh 6068891373
Add stateful reordering test for TwoDimensionalViewport (#142375)
Adds a test to validate state is preserved after reordering in `TwoDimensionalViewport` (reference: https://github.com/flutter/flutter/pull/141504#pullrequestreview-1837501775).

- Fixes #130754
2024-02-29 23:03:53 +00:00
Lau Ching Jun cfa011dd9d
Fix a crash in remote device daemon. (#144358)
The daemon server is expecting the client to pass `deviceId` in `device.shutdownDartDevelopmentService` method.

24a792dae1/packages/flutter_tools/lib/src/commands/daemon.dart (L1239)
2024-02-29 22:29:08 +00:00
Qun Cheng 1349c591cc
Remove toggleableActiveColor from ThemeData (#144178)
This PR is to remove deprecated ThemeData.toggleableActiveColor.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/97972.
Part of https://github.com/flutter/flutter/pull/111080
2024-02-29 20:58:11 +00:00
LongCatIsLooong 726e5d28c0
Add FocusNode.focusabilityListenable (#144280)
This is for https://github.com/flutter/flutter/issues/127803: a text field should unregister from the scribble scope, when it becomes unfocusable. 

When a `FocusNode` has listeners and its `_canRequestFocus` flag is set to true, it adds `+1` to `_focusabilityListeningDescendantCount` of all ancestors until it reaches the first ancestor with `descendantsAreFocusable = false`. When the a `FocusNode`'s `descendantsAreFocusable` changes, all listeners that contributed to its `_focusabilityListeningDescendantCount` will be notified.
2024-02-29 20:40:46 +00:00
Bruno Leroux e92bca3ff5
[flutter_tools] Update external link in Android manifest template (#144302)
## Description

This PR simplifies one external link in a commented section of the Android manifest template.

## Related Issue

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

## Tests

Documentation only PR.
2024-02-29 06:47:19 +00:00
Justin McCandless ac66b295c7
Docs on the interaction between Shortcuts and text input (#144328)
I was talking with @tvolkert about the complex behavior of Shortcuts when a text field is focused.  I created [this dartpad](https://dartpad.dev/?id=0b5c08fa85637422baa84927b7f1ee5f) to illustrate the problem, which shows a key being stolen from a text field by Shortcuts, and how to prevent that using DoNothingAndStopPropagationIntent.

This PR adds a section in the docs explaining how all of this works and how to override this "stealing" problem.
2024-02-29 01:09:18 +00:00
Dan Field 835112de79
Use robolectric/AndroidJUnit4 for integration test tests (#144348)
This allows relanding https://github.com/flutter/engine/pull/51056. The patch introduced a change where a static member is initialized from `View.generateViewId()` instead of conditionally using that API. Without an implementation for that in android.jar, the test will fail. The test in here currently is using a fake implementation that creates errors seen below.

See https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8754827734484522225/+/u/run_plugin_test/stdout#L46564_2 for failure. More detailed failure information is available locally in the `build` folder:

```
Mockito cannot mock this class: class io.flutter.embedding.android.FlutterActivity.

If you're not sure why you're getting this error, please open an issue on GitHub.

Java               : 17
JVM vendor name    : JetBrains s.r.o.
JVM vendor version : 17.0.7+0-17.0.7b1000.6-10550314
JVM name           : OpenJDK 64-Bit Server VM
JVM version        : 17.0.7+0-17.0.7b1000.6-10550314
JVM info           : mixed mode
OS name            : Mac OS X
OS version         : 14.3.1

You are seeing this disclaimer because Mockito is configured to create inlined mocks.
You can learn about inline mocks and their limitations under item #39 of the Mockito class javadoc.

Underlying exception : org.mockito.exceptions.base.MockitoException: Cannot instrument class io.flutter.embedding.android.FlutterActivity because it or one of its supertypes could not be initialized
	at app//dev.flutter.plugins.integration_test.FlutterDeviceScreenshotTest.getFlutterView_returnsFlutterViewForFlutterActivity(FlutterDeviceScreenshotTest.java:32)
	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base@17.0.7/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base@17.0.7/java.lang.reflect.Method.invoke(Unknown Source)
	at app//org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at app//org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at app//org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at app//org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at app//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at app//org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at app//org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at app//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at app//org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at app//org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at app//org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at app//org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at app//org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at app//org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at app//org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at app//org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base@17.0.7/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base@17.0.7/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base@17.0.7/java.lang.reflect.Method.invoke(Unknown Source)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:133)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:71)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at app//worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
Caused by: org.mockito.exceptions.base.MockitoException: Cannot instrument class io.flutter.embedding.android.FlutterActivity because it or one of its supertypes could not be initialized
	at app//net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
	at app//net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
	at app//net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
	at app//net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
	... 44 more
Caused by: java.lang.RuntimeException: Method generateViewId in android.view.View not mocked. See http://g.co/androidstudio/not-mocked for details.
	at android.view.View.generateViewId(View.java)
	at io.flutter.embedding.android.FlutterActivity.&lt;clinit&gt;(FlutterActivity.java:218)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.assureInitialization(InlineBytecodeGenerator.java:236)
	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.triggerRetransformation(InlineBytecodeGenerator.java:261)
	at org.mockito.internal.creation.bytebuddy.InlineBytecodeGenerator.mockClass(InlineBytecodeGenerator.java:218)
	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.lambda$mockClass$0(TypeCachingBytecodeGenerator.java:47)
	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:168)
	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:399)
	at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:190)
	at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:410)
	at org.mockito.internal.creation.bytebuddy.TypeCachingBytecodeGenerator.mockClass(TypeCachingBytecodeGenerator.java:40)
	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMockType(InlineDelegateByteBuddyMockMaker.java:396)
	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.doCreateMock(InlineDelegateByteBuddyMockMaker.java:355)
	at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.createMock(InlineDelegateByteBuddyMockMaker.java:334)
	at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.createMock(InlineByteBuddyMockMaker.java:56)
	at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:99)
	at org.mockito.internal.MockitoCore.mock(MockitoCore.java:88)
	at org.mockito.Mockito.mock(Mockito.java:2087)
	at org.mockito.Mockito.mock(Mockito.java:2002)
	... 44 more
```
2024-02-29 00:57:24 +00:00
LongCatIsLooong dddbd047d1
Reland "Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)" (#144330)
The [internal test failure](https://github.com/flutter/flutter/pull/144207#issuecomment-1968236339) was caused by `Focus.withExternalFocusNode` modifying the external node's attributes. The extra changes are in this commit:  e53d98b06c

CL with (almost) passing TGP: cl/611157582
2024-02-29 00:48:01 +00:00
Tong Mu e316022227
ReportTiming callback should record the sendFrameToEngine when it was scheduled (#144212)
Fixes https://github.com/flutter/flutter/issues/144261
2024-02-29 00:47:55 +00:00
Justin McCandless e6a6a473f7
Mention SelectionArea in SelectableText docs (#143784)
Most users should be using SelectionArea over SelectableText, so this makes that more clear/discoverable in the docs.
2024-02-28 14:36:08 -08:00
Qun Cheng 0d8eafb006
Reland "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2" (#144273) 2024-02-28 13:55:50 -08:00
Tomasz Gucio 88f75712d7
Remove irrelevant comment in TextPainter (#144308)
This PR removes an irrelevant comment in `TextPainter` for `_computePaintOffsetFraction`. Also some typos are corrected and missing spaces/newlines added.

test-exempt: no functional change
2024-02-28 21:47:06 +00:00
Victoria Ashworth 39a13539e0
Reland "Add FlutterMacOS.xcframework artifact (#143244)" (#144275)
Reland https://github.com/flutter/flutter/pull/143244. It was reverted due to https://github.com/flutter/flutter/issues/144251, which is fixed by https://github.com/flutter/engine/pull/51023.
2024-02-28 20:09:54 +00:00
Christopher Fujino f89b4f151e
[flutter_tools] Catch rpc error in render frame with raster stats (#144190)
Fixes https://github.com/flutter/flutter/issues/143010. This is intended to be cherrypicked into the 3.19 and 3.20 releases.

Long-term, we should deprecate this feature: https://github.com/flutter/flutter/issues/144191
2024-02-28 18:54:18 +00:00
Alex Li 47b0ef8127
🛡️ Guard Flutter Android app by disallow task affinity by default (#144018)
Partial resolution for #63559

## 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.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [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-02-28 10:31:36 -08:00
auto-submit[bot] 450506868d
Reverts "Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)" (#144292)
Reverts flutter/flutter#144207

Initiated by: CaseyHillers

Reason for reverting: b/327301206 - Breaking a customer test

Original PR Author: LongCatIsLooong

Reviewed By: {gspencergoog}

This change reverts the following previous change:
Original Description:
`FocusNode.canRequestFocus` was doing a double traversal if no ancestor disallows focus. The last for loop only has to reach as far as the enclosing scope.

Also this caches the `FocusNode.enclosingScope` since the getter access happens much more frequently than node reparenting.
2024-02-28 05:06:47 +00:00
Polina Cherkasova 42b02d0a3a
Use const route for notAnnounced. (#144050) 2024-02-27 16:17:59 -08:00
Taha Tesser 551731697e
Add tabs_utils.dart class (#143937)
This a test utility class for `tabs_test.dart` to prepare the class for Material 3 tests updates.

More info in https://github.com/flutter/flutter/issues/139076
2024-02-28 00:17:20 +00:00
Qun Cheng e707f0de69
Remove bottomAppBarColor from ThemeData (#144080)
This PR is to remove deprecated ThemeData.bottomAppBarColor.

These parameters are made obsolete in https://github.com/flutter/flutter/pull/110162.
Part of https://github.com/flutter/flutter/pull/111080
2024-02-28 00:07:51 +00:00
ufolux d0fb2929df
fix: unexpected chinese punctuation (#143678)
*Fixed the issue with abnormal Chinese punctuation marks.*
2024-02-27 23:47:22 +00:00
Elias Yishak d3b60d4649
Clean up lint ignores (#144229)
Fixes:
- https://github.com/dart-lang/tools/issues/234

Bumps the version for package:unified_analytics and removes TODOs and lint ignores
2024-02-27 23:21:03 +00:00
hangyu fdb17ab069
Reland [a11y] Add isEnabled semantics flag to text field (#143601)
Reland #143334
2024-02-27 22:49:13 +00:00
LongCatIsLooong 2c2fed1dfb
Remove deprecated CupertinoContextMenu.previewBuilder (#143990)
It was deprecated in https://github.com/flutter/flutter/pull/110616.

Deprecated in https://github.com/flutter/flutter/pull/110616
2024-02-27 22:49:10 +00:00
auto-submit[bot] 2eee0b5750
Reverts "Reland - Introduce tone-based surfaces and accent color add-ons - Part 2 (#144001)" (#144262)
Reverts flutter/flutter#144001

Initiated by: Piinks

Reason for reverting: Failing goldens at the tip of tree

Original PR Author: QuncCccccc

Reviewed By: {HansMuller}

This change reverts the following previous change:
Original Description:
Reverts flutter/flutter#143973

This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958.
2024-02-27 22:04:18 +00:00
auto-submit[bot] 7f2b238c55
Reverts "Add FlutterMacOS.xcframework artifact (#143244)" (#144253)
Reverts flutter/flutter#143244

Initiated by: vashworth

Reason for reverting: Increased `flutter_framework_uncompressed_bytes` - see https://github.com/flutter/flutter/issues/144251

Original PR Author: vashworth

Reviewed By: {jmagman}

This change reverts the following previous change:
Original Description:
Replace `FlutterMacOS.framework` cached artifact with `FlutterMacOS.xcframework`. Also, update usage of `FlutterMacOS.framework` to use `FlutterMacOS.xcframework`.

Part of https://github.com/flutter/flutter/issues/126016.
2024-02-27 20:47:26 +00:00
Martin Kustermann 616a0260fe
[web] Make flutter web profile builds always keep wasm symbols (#144130)
So far `flutter build web --wasm` was always stripping wasm symbols
except if `--no-strip-wasm` is passed.

=> Ensure that in profile mode we also keep the symbols
2024-02-27 21:21:42 +01:00
Qun Cheng 871d59221c
Reland - Introduce tone-based surfaces and accent color add-ons - Part 2 (#144001)
Reverts flutter/flutter#143973

This is a reland for #138521 with an updated g3fix(cl/605555997). Local test: cl/609608958.
2024-02-27 20:21:14 +00:00
LongCatIsLooong c353cb0123
Cache FocusNode.enclosingScope, clean up descendantsAreFocusable (#144207)
`FocusNode.canRequestFocus` was doing a double traversal if no ancestor disallows focus. The last for loop only has to reach as far as the enclosing scope.

Also this caches the `FocusNode.enclosingScope` since the getter access happens much more frequently than node reparenting.
2024-02-27 19:16:06 +00:00
LongCatIsLooong a23c81333f
Remove strut migration flag from TextPainter (#144242)
Fixes https://github.com/flutter/flutter/issues/142969.

G3fix: cl/610790040
2024-02-27 19:13:58 +00:00
Victoria Ashworth d1d9605974
Remove force Xcode debug workflow (#144185)
Now that all tests are on Xcode 15 and iOS 17, we no longer need to force test Xcode debug workflow.

Related https://github.com/flutter/flutter/issues/144020.
2024-02-27 18:18:07 +00:00
Victoria Ashworth 42252cd4c6
Add FlutterMacOS.xcframework artifact (#143244)
Replace `FlutterMacOS.framework` cached artifact with `FlutterMacOS.xcframework`. Also, update usage of `FlutterMacOS.framework` to use `FlutterMacOS.xcframework`.

Part of https://github.com/flutter/flutter/issues/126016.
2024-02-27 16:47:53 +00:00
Jia Hao c30f998eb5
[flutter_tools] Fix missing stack trace from daemon (#144113)
When the daemon throws an exception, the receiving client is unable to surface stack traces from the daemon.

This is because it is sent with the `trace` key here:

1e8dd1e4d6/packages/flutter_tools/lib/src/daemon.dart (L308)

But the client tries to read it with the `stackTrace` key here:

1e8dd1e4d6/packages/flutter_tools/lib/src/daemon.dart (L343)

Thanks to @mraleph for spotting this!

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

b/326825892
2024-02-27 08:39:49 +00:00
Polina Cherkasova 523b0c4d84
Move debugShowWidgetInspectorOverride (#144029)
Contributes to https://github.com/dart-lang/leak_tracker/issues/218
2024-02-26 23:55:52 +00:00
Nate 7b5ec588d1
Allow Listenable.merge() to use any iterable (#143675)
This is a very small change that fixes #143664.
2024-02-26 23:52:23 +00:00
Gustl22 b4f925e85a
refactor: Differentiate pubspec and resolution errors for plugins (#142035)
Part of #137040 and #80374

- Differentiate pubspec and resolution errors
- Rename platform to platformKey
- Add TODO for rework logic of flag [throwOnPluginPubspecError]
- Swap for loop: handle by platform and then by plugin
2024-02-26 19:45:18 +00:00
Nate 60d28ad913
Implementing switch expressions in rendering/ (#143812)
This pull request is part of the effort to solve issue #136139.

The previous [`switch` expressions PR](https://github.com/flutter/flutter/pull/143496) was comprised of many simple changes throughout `flutter/lib/src/`, but due to some more in-depth refactoring in `flutter/lib/src/rendering/`, I decided to submit the changes to this directory as a separate pull request.

There was really just one function that I changed significantly; I'll add a comment for explanation.
2024-02-26 17:36:21 +00:00
Victoria Ashworth 45c8881eb2
Update copyDirectory to allow links to not be followed (#144040)
In other words, copy links within a directory as links rather than copying them as files/directories. 

Fixes https://github.com/flutter/flutter/issues/144032.
2024-02-26 16:07:22 +00:00
Taha Tesser 41b1aea281
Fix Scrollbar.thickness property is ignored when the Scrollbar is hovered (#144012)
fixes [`Scrollbar.thickness` property is ignored when the `Scrollbar` is hovered](https://github.com/flutter/flutter/issues/143881)

### 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) {
    final ScrollController scrollController = ScrollController();

    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Material(
        child: ScrollConfiguration(
          behavior: const NoScrollbarBehavior(),
          child: ScrollbarTheme(
            data: ScrollbarThemeData(
              thickness: MaterialStateProperty.all(25.0),
              showTrackOnHover: true,
            ),
            child: Scrollbar(
              thickness: 50.0,
              thumbVisibility: true,
              radius: const Radius.circular(3.0),
              controller: scrollController,
              child: SingleChildScrollView(
                controller: scrollController,
                child: const SizedBox(width: 4000.0, height: 4000.0),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

class NoScrollbarBehavior extends ScrollBehavior {
  const NoScrollbarBehavior();

  @override
  Widget buildScrollbar(
          BuildContext context, Widget child, ScrollableDetails details) =>
      child;
}
```

</details>

### Preview

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/3537d60d-a5b2-488d-aa99-4c36c3721657"  /> | <img src="https://github.com/flutter/flutter/assets/48603081/cfd02095-a327-4b16-8ece-0d1c9e6813ce" /> |
2024-02-26 10:34:27 +00:00
MarkZ ee94fe262b
Adding support for DDC modules when running Flutter Web in debug mode (#141423)
### Context:

DDC modules are abstractions over how libraries are loaded/updated. The entirety of google3 uses the DDC/legacy module system due to its flexibility extensibility over the other two (ES6 and AMD/RequireJS). Unifying DDC's module system saves us from duplicating work and will allow us to have finer grained control over how JS modules are loaded. This is a a prerequisite to features such as hot reload.

### Overview:

This change plumbs a boolean flag through flutter_tools that switches between DDC (new) and AMD (current) modules. This mode is automatically applied when `--extra-front-end-options=--dartdevc-module-format=ddc` is specified alongside `flutter run`. Other important additions include:
* Splitting Flutter artifacts between DDC and AMD modules
* Adding unit tests for the DDC module system
* Additional bootstrapper logic for the DDC module system

We don't expect to see any user-visible behavior or performance differences.

This is dependent on [incoming module system support in DWDS](https://github.com/dart-lang/webdev/pull/2295) and [additional artifacts in the engine](https://github.com/flutter/engine/pull/47783).

This is part of a greater effort to deprecate the AMD module system: https://github.com/dart-lang/sdk/issues/52361
2024-02-24 00:26:04 +00:00
Andrew Kolos 37c8df1690
allow optional direct injection of Config instance into DevFS (#144002)
In service of https://github.com/flutter/flutter/issues/143348

This will make testing of asset transformation hot reload behavior easier (specifically in that we can avoid having to write a test that looks like this: 5d02c27248/packages/flutter_tools/test/general.shard/build_system/targets/assets_test.dart (L167-L249)
2024-02-23 23:39:49 +00:00
Andrew Kolos 4e814a5f3c
Enable asset transformation for flutter build for iOS, Android, Windows, MacOS, Linux, and web (also flutter run without hot reload support) (#143815)
See title. These are are the platforms that use the `CopyAssets` `Target` as part of their build target.

Partial implementation of https://github.com/flutter/flutter/issues/143348.
2024-02-23 22:48:08 +00:00
Tong Mu be2544ab59
Render the warm up frame in a proper rendering process (#143290)
_This PR requires https://github.com/flutter/engine/pull/50570._

This PR uses the new `PlatformDispatcher.scheduleWarmUpFrame` API to render warm up frames.

For why the warm up frame must involve the engine to render, see https://github.com/flutter/flutter/issues/142851.
2024-02-23 21:30:14 +00:00
Jonah Williams 895406c60b
disable debug banner in m3 page test apps. (#143857)
This one flakes but rarely.

Part of https://github.com/flutter/flutter/issues/143616
2024-02-23 20:06:06 +00:00
LongCatIsLooong a0a854a78b
Relands "Changing TextPainter.getOffsetForCaret implementation to remove the logarithmic search (#143281)" (reverted in #143801) (#143954)
The original PR was reverted because the new caret positioning callpath triggered a skparagraph assert. The assert has been removed. Relanding the PR with no changes applied.
2024-02-23 19:20:14 +00:00
Nate c53a18f4e4
Implementing null-aware operators throughout the repository (#143804)
This pull request fixes #143803 by taking advantage of Dart's null-aware operators.

And unlike `switch` expressions ([9 PRs](https://github.com/flutter/flutter/pull/143634) and counting), the Flutter codebase is already fantastic when it comes to null-aware coding. After refactoring the entire repo, all the changes involving `?.` and `??` can fit into a single pull request.
2024-02-23 19:02:22 +00:00
LongCatIsLooong fcd154bd24
Remove deprecated InteractiveViewer.alignPanAxis (#142500) 2024-02-23 04:24:21 +00:00
LongCatIsLooong 59da873ef0
Remove deprecated KeepAliveHandle.release (#143961)
https://github.com/flutter/flutter/issues/143956

I still did not include a dartfix since a dartfix that replaces `release` with `dispose` would change the semantics and may cause a runtime crash instead of a build error.

@Piinks  does setting `bulkApply` to false force the user to apply the fix to every occurrence one by one in their IDE? If so then it seems that would be the way to go for this deprecation?
2024-02-23 03:16:20 +00:00
Michael Goderbauer 10a50bcc7a
Remove deprecated AnimatedListItemBuilder, AnimatedListRemovedItemBuilder (#143974)
https://github.com/flutter/flutter/issues/143956
2024-02-23 02:28:05 +00:00
Kate Lovett 20078f89bc
Remove deprecated TimelineSummary.writeSummaryToFile (#143983)
https://github.com/flutter/flutter/issues/143956
2024-02-23 01:55:20 +00:00
Michael Goderbauer ccf9c15071
Remove deprecated MediaQuery.boldTextOverride (#143960)
https://github.com/flutter/flutter/issues/143956
2024-02-23 00:06:24 +00:00
Kate Lovett cbab555dbb
Remove deprecated FlutterDriver.enableAccessibility (#143979)
https://github.com/flutter/flutter/issues/143956
2024-02-22 23:24:32 +00:00
Qun Cheng 4715216c01
Revert "Introduce tone-based surfaces and accent color add-ons - Part 2" (#143973)
Reverts flutter/flutter#138521
2024-02-22 14:51:28 -08:00
dsanagustin 16535924f2
Add CloseButtonTooltip to the 'X' button on a SnackBar (#143934)
Adds a localized Close Button tooltip to the 'X' Button on a SnackBar, making it readable by screen readers.

Github Issue #143793 

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-02-22 22:45:29 +00:00
Martin Kustermann b09ca497bb
Use inlining annotations on important methods for all targets (#143923) 2024-02-22 23:04:25 +01:00
LongCatIsLooong 44e440ae9d
Add missing TextPainter.strutStyle to paragraph style (#143771)
Fixes an issue where if the `TextSpan` doesn't have a text style, the specified strutStyle is not applied.

Additionally, adds a migration flag for https://github.com/flutter/engine/pull/50385, for internal golden changes. It's only going to exist for a week.
2024-02-22 19:33:20 +00:00
Kostia Sokolovskyi f0205354b4
Add CurvedAnimation disposals in some widgets (#143790)
Contributes to https://github.com/flutter/flutter/issues/141198

### Description
- Adds `CurvedAnimation` disposals to `material/chip.dart`, `material/input_decorator.dart`, `material/toggleable.dart`, `widgets/animated_switcher.dart`, `widgets/overscroll_indicator.dart`.
2024-02-22 19:16:25 +00:00
Andrew 9176f7b6fc
Fix documentation typo in basic.dart (#143887)
Fixes a small documentation typo.
2024-02-22 19:08:31 +00:00
Tirth 3053b6ce5b
Fixed Small Typo in Emulators Test Name (#143578)
Fixed Small Typo in Emulators Test Name. I filed #140656 and it was fixed in #142853. I noticed this one there and decided to send a fix.
2024-02-22 18:35:21 +00:00
Derek Xu dfb5888e8f
Support using lightweight Flutter Engines to run tests (#141726)
This PR implements the functionality described above and hides it behind
the `--experimental-faster-testing` flag of `flutter test`.

### The following are some performance measurements from test runs
conducted on GitHub Actions

run 1 logs:
https://github.com/derekxu16/flutter_test_ci/actions/runs/8008029772/attempts/1
run 2 logs:
https://github.com/derekxu16/flutter_test_ci/actions/runs/8008029772/attempts/2
run 3 logs:
https://github.com/derekxu16/flutter_test_ci/actions/runs/8008029772/attempts/3

**length of `flutter test --reporter=expanded test/animation
test/foundation` step**

run 1: 54s
run 2: 52s
run 3: 56s

average: 54s

**length of `flutter test --experimental-faster-testing
--reporter=expanded test/animation test/foundation` step**

run 1: 27s
run 2: 27s
run 3: 29s

average: 27.67s (~48.77% shorter than 54s)

**length of `flutter test --reporter=expanded test/animation
test/foundation test/gestures test/painting test/physics test/rendering
test/scheduler test/semantics test/services` step**

run 1: 260s
run 2: 270s
run 3: 305s

average: 278.33s


**length of `flutter test --experimental-faster-testing
--reporter=expanded test/animation test/foundation test/gestures
test/painting test/physics test/rendering test/scheduler test/semantics
test/services` step**

from a clean build (right after deleting the build folder):

run 1: 215s
run 2: 227s
run 3: 245s

average: 229s (~17.72% shorter than 278.33s)

Note that in reality, `test/material` was not passed to `flutter test`
in the trials below. All of the test files under `test/material` except
for `test/material/icons_test.dart` were listed out individually

**length of `flutter test --reporter=expanded test/material` step**

run 1: 408s
run 2: 421s
run 3: 451s

average: 426.67s

**length of `flutter test --experimental-faster-testing
--reporter=expanded test/material` step**

run 1: 382s
run 2: 373s
run 3: 400s

average: 385s (~9.77% shorter than 426.67s)

---------

Co-authored-by: Dan Field <dnfield@google.com>
2024-02-22 13:32:29 -05:00
Kate Lovett f97978f9f3
Re-use methods to calculate leading and trailing garbage in RenderSliverMultiBoxAdaptor (#143884)
My RenderSliverMultiBoxAdaptor/RenderSliverFixedExtentList/RenderSliverVariedExtentList yak shave continues.

I've been subclassing RenderSliverVariedExtentList for SliverTree and have found some opportunities for clean up.
There is a larger clean up I'd like to do, but this week SliverTree comes first. 

I noticed these methods were getting repeated 🔁, and I was about to repeat them again 🔁 for the tree, so I figured bumping them up to the base class was better than continuing to copy-paste the same methods.
2024-02-22 01:56:39 +00:00
Jonah Williams d699bcb44c
Disable color filter sepia test for Impeller. (#143861)
This test is still unstable with the debug banner disabled. the Icon in the FAB appears to be shifting.
2024-02-21 21:06:19 +00:00
Kate Lovett 09e0e1b88e
Deprecate redundant itemExtent in RenderSliverFixedExtentBoxAdaptor methods (#143412)
Multiple methods in `RenderSliverFixedExtentBoxAdaptor` pass a `double itemExtent` for computing things like what children will be laid out, what the max scroll offset will be, and how the children will be laid out.

Since `RenderSliverFixedExtentBoxAdaptor` was further subclassed to support a `itemExtentBuider` in `RenderSliverVariedExtentList`, these itemExtent parameters became useless when using that RenderObject. Reading through `RenderSliverFixedExtentBoxAdaptor.performLayout`, the remaining artifacts of passing around itemExtent make it hard to follow when it is irrelevant. 

`RenderSliverFixedExtentBoxAdaptor.itemExtent` is available from these methods, so it does not need to pass it. It is redundant API.

Plus, if a bogus itemExtent is passed for some reason, errors will ensue and the layout will be incorrect. 💣 💥 

Deprecating so we can remove these for a cleaner API. Unfortunately this is not supported by dart fix, but the fact that these methods are protected means usage outside of the framework is likely minimal.
2024-02-21 20:10:03 +00:00
Reid Baker b09a015ff5
Add aab as alias for appbundle (#143855)
- **Fix #143778 add aab as alias to appbundle**

Fixes #143778
2024-02-21 18:19:41 +00:00
Taha Tesser 3403ca413f
Update hourMinuteTextStyle defaults for Material 3 Time Picker (#143749)
fixes [`hourMinuteTextStyle` Material 3 default doesn't match the specs](https://github.com/flutter/flutter/issues/143748)

This updates `hourMinuteTextStyle` defaults to match Material 3 specs. `hourMinuteTextStyle` should use different font style for different entry modes based on the specs.

### Specs
![Screenshot 2024-02-20 at 15 06 40](https://github.com/flutter/flutter/assets/48603081/5198a5da-314d-401e-8d7f-d4a68b86e43c)
![Screenshot 2024-02-20 at 15 07 22](https://github.com/flutter/flutter/assets/48603081/79436ce4-fef6-480a-bc43-b628497e860f)

### Before
```dart
 return _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states));
```
### After 
```dart
      return entryMode == TimePickerEntryMode.dial
        ? _textTheme.displayLarge!.copyWith(color: _hourMinuteTextColor.resolve(states))
        : _textTheme.displayMedium!.copyWith(color: _hourMinuteTextColor.resolve(states));
```
2024-02-21 10:39:35 +00:00
Taha Tesser 5d2353c105
CalendarDatePicker doesn't announce selected date on desktop (#143583)
fixes [Screen reader is not announcing the selected date as selected on DatePicker](https://github.com/flutter/flutter/issues/143439)

### Descriptions
- This fixes an issue where `CalendarDatePicker` doesn't announce selected date on desktop.
- Add semantic label to describe the selected date is indeed "Selected".

### 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: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  MyHomePageState createState() => MyHomePageState();
}

class MyHomePageState extends State<MyHomePage> {
  void _showDatePicker() async {
    await showDatePicker(
      context: context,
      initialDate: DateTime.now(),
      firstDate: DateTime(1900),
      lastDate: DateTime(2200),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title,
            style: const TextStyle(fontFamily: 'ProductSans')),
      ),
      body: const Center(
        child: Text('Click the button to show date picker.'),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _showDatePicker,
        tooltip: 'Show date picker',
        child: const Icon(Icons.edit_calendar),
      ),
    );
  }
}

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

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

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

//   @override
//   Widget build(BuildContext context) {
//     return MaterialApp(
//       debugShowCheckedModeBanner: false,
//       home: Scaffold(
//         body: Center(
//           child: CalendarDatePicker(
//             initialDate: DateTime.now(),
//             firstDate: DateTime(2020),
//             lastDate: DateTime(2050),
//             onDateChanged: (date) {
//               print(date);
//             },
//           ),
//         ),
//       ),
//     );
//   }
// }
```

</details>

### Before

https://github.com/flutter/flutter/assets/48603081/c82e1f15-f067-4865-8a5a-1f3c0c8d91da

### After

https://github.com/flutter/flutter/assets/48603081/193d9e26-df9e-4d89-97ce-265c3d564607
2024-02-21 08:59:24 +00:00
Taha Tesser 95cdebedae
Add timeSelectorSeparatorColor and timeSelectorSeparatorTextStyle for Material 3 Time Picker (#143739)
fixes [`Time selector separator` in TimePicker is not centered vertically](https://github.com/flutter/flutter/issues/143691)

Separator currently `hourMinuteTextStyle` to style itself.

This introduces `timeSelectorSeparatorColor` and `timeSelectorSeparatorTextStyle` from Material 3 specs to correctly style  the separator. This also adds ability to change separator color without changing `hourMinuteTextColor`.

### Specs for the time selector separator
https://m3.material.io/components/time-pickers/specs
![image](https://github.com/flutter/flutter/assets/48603081/0c84f649-545d-441b-adbf-2b9ec872b14c)

### Code sample

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

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

void main() {
  runApp(const App());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        // timePickerTheme: TimePickerThemeData(
        //   hourMinuteTextColor: Colors.amber,
        // )
      ),
      home: Scaffold(
        body: Center(
          child: Builder(builder: (context) {
            return ElevatedButton(
              onPressed: () async {
                await showTimePicker(
                  context: context,
                  initialTime: TimeOfDay.now(),
                );
              },
              child: const Text('Pick Time'),
            );
          }),
        ),
      ),
    );
  }
}

```

</details>

| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/20beeba4-5cc2-49ee-bba8-1c552c0d1e44" /> | <img src="https://github.com/flutter/flutter/assets/48603081/24927187-aff7-4191-930c-bceab6a4b4c2" /> |
2024-02-21 08:10:01 +00:00
Jonah Williams f58a162da0
more fixes to unstable impeller goldens. (#143811)
Part of  https://github.com/flutter/flutter/issues/143616
2024-02-21 03:14:19 +00:00
Kevin Moore bc334396db
[flutter_tools] enable wasm compile on beta channel (#143779)
Wasm compilation is now available on `master` and `beta` channels.
2024-02-21 01:20:04 +00:00
Simon Friis Vindum 6c78e36ccb
Fix initialization of time in repeat on AnimationController (#142887)
This PR fixes #142885.

The issue is that in `_RepeatingSimulation` the initial time is calculated as follows:

```
(initialValue / (max - min)) * (period.inMicroseconds / Duration.microsecondsPerSecond)
```

This calculation does not work in general. For instance, if `max` is 300, `min` is 100, and `initialValue` is 100 then `initialValue / (max - min)` is 1/2 when it should be 0

The current tests work by happenstance because the numbers used happen to work. To reveal the bug I've added some more tests similar to the existing ones but with different numbers.

A "side-effect" of the incorrect calculation is that if `initialValue` is 0, then the animation will always start from `min` no matter what. For instance, in one of the tests, an `AnimationController` with the value 0 is told to `repeat` between 0.5 and 1.0, and this starts the animation from 0.5. To preserve this behavior, and to more generally handle the case where the initial value is out of bounds, this PR clamps the initial value to be within the lower and upper bounds of the repetition.

Just for reference, this calculation was introduced at https://github.com/flutter/flutter/pull/25125.
2024-02-21 00:36:08 +00:00
Jonah Williams 1e822ca2fd
Disable debug banner to stabilize impeller goldens. (#143794)
Fixes some of https://github.com/flutter/flutter/issues/143616 by disabling the debug banner, which does not appear to be a critical part of the golden.
2024-02-21 00:34:11 +00:00
auto-submit[bot] f9b3b84d4e
Reverts "Changing TextPainter.getOffsetForCaret implementation to remove the logarithmic search (#143281)" (#143801)
Reverts flutter/flutter#143281

Initiated by: LongCatIsLooong

Reason for reverting: https://github.com/flutter/flutter/issues/143797

Original PR Author: LongCatIsLooong

Reviewed By: {justinmc, jason-simmons}

This change reverts the following previous change:
Original Description:
The behavior largely remains the same, except:

1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. 
  For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). 
  This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. 
  And it makes the navigation order consistent for `aA\naA`:
```
  |aA    =>  aA|  => aA|  => aA  => aA   => aA 
   aA        aA      aA     |aA     aA|     aA|     
   (1)       (2)     (3)    (4)    (5)      (6)
```
This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). 
But logical order navigation will always be confusing in bidi text, in one way or another.

Interestingly there are 3 different behaviors I've observed in chrome:
- the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and 
- its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). 
- On the other hand, its (new) omnibar seems to use visual order arrow navigation

Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 

2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424.

## Internal Tests

This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
2024-02-21 00:10:18 +00:00
LongCatIsLooong 174e58697c
Avoid applying partial dartfixes on CI (#143551)
Unblocks https://github.com/flutter/tests/pull/345

Add `bulkApply: false` to partial fixes so they don't automatically get applied on registered tests.
2024-02-20 23:27:26 +00:00
Nate fc07b241ae
Implement _suspendedNode fix (#143556)
Previously we merged #142930, to solve issue #87061.

Since then, I discovered that the keyboard input wasn't being captured after the app had been paused and resumed. After some digging, I realized that the problem was due to [a line in editable_text.dart](d4b1b6e744/packages/flutter/lib/src/widgets/editable_text.dart (L3589)) that called the `focusNode.consumeKeyboardToken()` method.

Luckily, it's a very easy fix: we just use `requestFocus()` instead of `applyFocusChangesIfNeeded()`. @gspencergoog could you take a look when you have a chance?
2024-02-20 22:46:22 +00:00
xubaolin 6707f5efbe
Change ItemExtentBuilder's return value nullable (#142428)
Fixes https://github.com/flutter/flutter/issues/138912

Change `ItemExtentBuilder`'s return value nullable, it should return null if asked to build an item extent with a greater index than exists.
2024-02-20 22:14:00 +00:00
Jonah Williams 4c0b5ccebc
[gold] Always provide host ABI to gold config (#143621)
This can help us split goldens that are different due to arm non-arm mac, et cetera.

Part of https://github.com/flutter/flutter/issues/143616
2024-02-20 21:06:01 +00:00
Andrew Kolos b491f16d9c
instead of exiting the tool, print a warning when using --flavor with an incompatible device (#143735)
Fixes https://github.com/flutter/flutter/issues/143574 by printing a warning (instead of exiting) when `--flavor` is used with a target platform that doesn't have flavors support.
2024-02-20 21:02:49 +00:00
Nate 7a4c2465af
Implementing switch expressions: everything in flutter/lib/src/ (#143634)
This PR is the 9ᵗʰ step in the journey to solve issue #136139 and make the entire Flutter repo more readable.

(previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793, #143293, #143496)

I did a pass through all of `packages/flutter/lib/src/` and found an abundance of `switch` statements to improve. Whereas #143496 focused on in-depth refactoring, this PR is full of simple, straightforward changes. (I ended up making some more complicated changes in `rendering/` and will file those separately after this PR is done.)
2024-02-20 21:02:47 +00:00
LongCatIsLooong 3538e4c788
Changing TextPainter.getOffsetForCaret implementation to remove the logarithmic search (#143281)
The behavior largely remains the same, except:

1. The EOT cursor `(textLength, downstream)` for text ending in the opposite writing direction as the paragraph is now placed at the visual end of the last line. 
  For example, in a LTR paragraph, the EOT cursor for `aA` (lowercase for LTR and uppercase for RTL) is placed to the right of the line: `aA|` (it was `a|A` before). 
  This matches the behavior of most applications that do logical order arrow key navigation instead of visual order navigation. 
  And it makes the navigation order consistent for `aA\naA`:
```
  |aA    =>  aA|  => aA|  => aA  => aA   => aA 
   aA        aA      aA     |aA     aA|     aA|     
   (1)       (2)     (3)    (4)    (5)      (6)
```
This is indeed still pretty confusing as (2) and (3), as well as (5) and (6) are hard to distinguish (when the I beam has a large width they are actually visually distinguishable -- they use the same anchor but one gets painted to the left and the other to the right. I noticed that emacs does the same). 
But logical order navigation will always be confusing in bidi text, in one way or another.

Interestingly there are 3 different behaviors I've observed in chrome:
- the chrome download dialog (which I think uses GTK text widgets but not sure which version) gives me 2 cursors when navigating bidi text, and 
- its HTML fields only show one, and presumably they place the I beam at the **trailing edge** of the character (which makes more sense for backspacing I guess). 
- On the other hand, its (new) omnibar seems to use visual order arrow navigation

Side note: we may need to update the "tap to place the caret here" logic to handle the case where the tap lands outside of the text and the text ends in the opposite writing direction. 

2. Removed the logarithmic search. The same could be done using the characters package but when glyphInfo tells you about the baseline location in the future we probably don't need the `getBoxesForRange` call. This should fix https://github.com/flutter/flutter/issues/123424.

## Internal Tests

This is going to change the image output of some internal golden tests. I'm planning to merge https://github.com/flutter/flutter/pull/143281 before this to avoid updating the same golden files twice for invalid selections.
2024-02-20 20:51:06 +00:00
Polina Cherkasova 39befd81dd
Clean leaks. (#142818) 2024-02-20 11:14:16 -08:00
Qun Cheng a2c7ed95d1
Introduce tone-based surfaces and accent color add-ons - Part 2 (#138521)
This PR is to introduce 19 new color roles and deprecate 3 color roles in `ColorScheme`.
**Tone-based surface colors** (7 colors): 
* surfaceBright
* surfaceDim
* surfaceContainer
* surfaceContainerLowest
* surfaceContainerLow
* surfaceContainerHigh
* surfaceContainerHighest

**Accent color add-ons** (12 colors):
* primary/secondary/tertiary-Fixed
* primary/secondary/tertiary-FixedDim
* onPrimary/onSecondary/onTertiary-Fixed
* onPrimary/onSecondary/onTertiary-FixedVariant

**Deprecated colors**:
* background -> replaced with surface
* onBackground -> replaced with onSurface
* surfaceVariant -> replaced with surfaceContainerHighest

Please checkout this [design doc](https://docs.google.com/document/d/1ODqivpM_6c490T4j5XIiWCDKo5YqHy78YEFqDm4S8h4/edit?usp=sharing) for more information:)

![Screenshot 2024-01-08 at 4 56 51 PM](https://github.com/flutter/flutter/assets/36861262/353cdb4c-6ba9-4435-a518-fd3f67e415f0)
2024-02-20 19:01:50 +00:00
Greg Price eacf0f9e41
Explain when and why to use CrossAxisAlignment.baseline (#143632)
Improves the docs around horizontal alignment of text, due to several issues expressing confusion about this topic.
2024-02-20 10:59:12 -08:00
Zachary Anderson 8a8616f913
Handle FormatException from SkiaGoldClient (#143755)
Seen in
https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20Framework%20Smoke%20Tests/17183/overview
closing the engine tree.
2024-02-20 09:57:23 -08:00
Greg Price 2d422a3261
Small fixes in TextEditingController docs (#143717)
This follows up on #143452, to slightly further address #95978.

The double- rather than triple-slash on the blank line caused it to be ignored by dartdoc, so that the two paragraphs it's intended to separate were getting joined as one paragraph instead.

Also expand this constructor's summary line slightly to mention its distinctive feature compared with the other constructor, and make other small fixes that I noticed in other docs on this class.
2024-02-20 05:49:05 +00:00
Gustl22 9620e3f69c
Reland (2): "Fix how Gradle resolves Android plugin" (#142498)
Previous PR: #137115, 
Revert: #142464
Fixes #141940
Closes #142487
2024-02-19 18:07:33 +00:00
yim bce848ebf9
Fixed the issue of incorrect item position when prototypeItem is set in SliverReorderableList. (#142880)
Fixes #142708
2024-02-18 02:30:18 +00:00
yim 73c26a1c0b
ShowCaretOnScreen is correctly scheduled within a SliverMainAxisGroup (#141671)
Fixes #141577 
Fixes #135407
2024-02-18 02:28:22 +00:00
Jason Simmons 8036488776
Add an override annotation to the lineTerminator setter in the MemoryStdout fake class (#143646)
This is required by a new API recently added to Dart.

See https://github.com/flutter/flutter/issues/143614
2024-02-17 16:41:27 +00:00
Bruno Leroux 8a5efa53d8
InputDecorator M3 tests migration - Step3 (#143520)
## Description

This PR is the third step for the M3 test migration for `InputDecorator`.
Step 1: https://github.com/flutter/flutter/pull/142981
Step 2: https://github.com/flutter/flutter/pull/143369

This PR moves some tests out of the 'Material2' group (the ones that are ok on M3).
@justinmc The diff is almost unreadable, I moved the tests as carefully as possible and I checked that before and after the number of tests is exactly the same. 

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076

## Tests

Move some tests from 'Material2' group to main().
2024-02-17 07:34:35 +00:00
Bruno Leroux 13ed551e19
Update InputDecoration.contentPadding documentation (#143519)
## Description

This PR updates the `InputDecoration.contentPadding` documentation to detail both Material 3 and Material 2 default values.

## Related Issue

Follow-up to https://github.com/flutter/flutter/pull/142981.

## Tests

Documentation only.
2024-02-17 07:24:34 +00:00
Jonah Williams ae1488cfe8
[Impeller] skip selectable text goldens for instability. (#143627)
Similar to other issues, appears that text goldens are really unstable with Impeller.

Part of https://github.com/flutter/flutter/issues/143616
2024-02-17 04:21:17 +00:00
Jonah Williams 4e27f3472c
[Impeller] skip perspective transformed text goldens. (#143623)
Part of https://github.com/flutter/flutter/issues/143616

The perspective transformed text goldens are super unstable, possibly for the same reason they are in flutter/engine.
2024-02-17 02:13:22 +00:00
Jonah Williams bb1c7a6ccb
[framework] Skip 5 failing framework tests. (#143618)
Part of https://github.com/flutter/flutter/issues/143616
2024-02-17 01:18:33 +00:00
Brian Quinlan e8dcf1909e
Implement lineTerminator in MemoryStdout Fake (#143608)
https://dart-review.googlesource.com/c/sdk/+/326761/24/sdk/lib/io/stdio.dart#380
added a `lineTerminator` field to `Stdout`.

Add that field to the fake in packages/test.

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

## 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 `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [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
2024-02-16 15:46:01 -08:00
LongCatIsLooong c61b9501e3
Don't paint the cursor for an invalid selection (#143533)
Fixes https://github.com/flutter/flutter/issues/79495

This is basically a reland of https://github.com/flutter/flutter/pull/79607.

Currently when the cursor is invalid, arrow key navigation / typing / backspacing doesn't work since the cursor position is unknown. 
Showing the cursor when the selection is invalid gives the user the wrong information about the current insert point in the text. 

This is going to break internal golden tests.
2024-02-16 23:40:26 +00:00
Michael Goderbauer 546bdec7ef
Fix implementation imports outside of lib (#143594)
Work towards https://github.com/dart-lang/linter/issues/4859

There are libraries outside a `lib/` directory, which violate `implementation_imports`.

Supersedes https://github.com/flutter/flutter/pull/143560.
2024-02-16 22:38:10 +00:00
Andrew Kolos 3a18473bd6
add parsing of assets transformer declarations in pubspec.yaml (#143557)
In service of https://github.com/flutter/flutter/issues/143348.

This PR enables parsing of the pubspec yaml schemes for assets with transformations as described in #143348.
2024-02-16 22:24:59 +00:00
Michael Goderbauer 50862bc04a
Fix SemanticsFinder for multi-view (#143485)
Fixes https://github.com/flutter/flutter/issues/143405.

It was counter-intuitive that a SemanticsFinder without specifying a FlutterView would only search the nodes in the default view. This change makes it so that when no view is specified the semantics trees of all known FlutterViews are searched.
2024-02-16 22:24:55 +00:00
Andrew Kolos 9a6bda87d9
rebuild the asset bundle if a file has been modified between flutter test runs (#143569)
Fixes https://github.com/flutter/flutter/issues/143513
Should be cherry-picked to beta.
2024-02-16 22:21:08 +00:00
Tirth 1b8742b9dc
Added Missing Field Name in Doc Comment in SnackBarThemeData (#143588)
Added Missing Field Name in Doc Comment in SnackBarThemeData.
2024-02-16 20:50:07 +00:00
Nate 944cd11d87
Implementing switch expressions [refactoring flutter/lib/src/] (#143496)
This PR is the 8ᵗʰ step in the journey to solve issue #136139 and make the entire Flutter repo more readable.

(previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793, #143293)

I did a pass through all of `packages/flutter/lib/src/` and found a whole bunch of `switch` statements to improve: most of them were really simple, but many involved some thorough refactoring.

This pull request is just the complicated stuff. 😎 I'll make comments to describe the changes, and then in the future there will be another PR (and it'll be much easier to review than this one).
2024-02-16 20:19:34 +00:00
Taha Tesser a603a17875
Update MaterialStatesController docs for calling setState in a listener (#143453)
fixes [Calling `setState` in a `MaterialStatesController` listener and `MaterialStateController.update` causes Exception](https://github.com/flutter/flutter/issues/138986)

### Description
`MaterialStatesController` listener  calls `setState` during build when `MaterialStatesController.update` listener calls `notifyListeners`.

I tried fixing this issue by putting `notifyListeners` in a post-frame callback. However, this breaks existing customer tests (particularly super editor tests).

A safer approach would be to document that the listener's `setState` call should be in a post-frame callback to delay it and not call this during the build phase triggered by the `MaterialStatesController.update` in the widgets such as InkWell or buttons.
2024-02-16 07:43:50 +00:00
Taha Tesser 8129797045
Update DataTable docs for disabled DataRow ink well (#143450)
fixes [[`DataTable`] Data row does not respond to `MaterialState.hovered`](https://github.com/flutter/flutter/issues/138968)
2024-02-16 06:56:59 +00:00
Martin Kustermann d4b1b6e744
Reland "Disentangle and align flutter build web --wasm flags (#143517)" (#143549)
Update: Accidentally use `--O4` instead of `-O4` in `dev/devicelab/lib/tasks/web_benchmarks.dart` update.

Original description:

* Make `flutter build web` have one option that determins the
optimization level: `-O<level>` / `--optimization-level=<level>` =>
Defaulting to -O4 => Will apply to both dart2js and dart2wasm

* Deprecate `--dart2js-optimization=O<level>`

* Disentagle concept of optimization from concept of static symbols =>
Add a `--strip-wasm` / `--no-strip-wasm` flag that determins whether
static symbols are kept in the resulting wasm file.

* Remove copy&past'ed code in the tests for wasm build tests

* Cleanup some artifacts code, now that we no longer use `wasm-opt`
inside flutter tools
2024-02-16 00:19:38 +00:00
Bartek Pacia c4b0322d57
Android Gradle file templates: make it easier to convert them to Kotlin DSL in the future (#142146)
This PR will make it easier for future Flutter-Android apps/plugins/modules etc. to migrate to Gradle Kotlin DSL.

This PR is similar to #140452 but concerns public Gradle templates instead of Flutter's internal Gradle code. It should be a no-op change.

**before**

![before](https://github.com/flutter/flutter/assets/40357511/5d0cb2bb-a693-43bc-aa10-b8f431e0c68c)

**after**

![after](https://github.com/flutter/flutter/assets/40357511/e4a945a5-866f-42f7-813b-b08b26bb89dc)
2024-02-15 23:42:13 +00:00
Jake 22d2703834
Fix minor spelling error (#143541)
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*

*List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2024-02-15 22:46:30 +00:00
Danny Tuppeny 86613d198e
[flutter_tool] [dap] Forward Flutter progress events to DAP client (#142524)
Builds can be slow and the legacy debug adapter would handle Flutter's `app.progress` events to update the toast notification during builds. This was lost in the new adapters - we should only a single "Launching.." notification for the whole progress.

This change listens to `app.progress` events and forwards those with `finished=false` to the client if the launch progress is still active.

Fixes https://github.com/Dart-Code/Dart-Code/issues/4938

https://github.com/flutter/flutter/assets/1078012/8c60cf08-e034-4a72-b31e-9c61dca388bf
2024-02-15 22:22:48 +00:00
auto-submit[bot] 86ca31d005
Reverts "Disentangle and align flutter build web --wasm flags (#143517)" (#143547)
Reverts flutter/flutter#143517

Initiated by: dnfield

Reason for reverting: broke CI, see https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20web_benchmarks_skwasm/3446/overview

Original PR Author: mkustermann

Reviewed By: {eyebrowsoffire}

This change reverts the following previous change:
Original Description:
* Make `flutter build web` have one option that determins the optimization level: `-O<level>` / `--optimization-level=<level>` => Defaulting to -O4 => Will apply to both dart2js and dart2wasm

* Deprecate `--dart2js-optimization=O<level>`

* Disentagle concept of optimization from concept of static symbols => Add a `--strip-wasm` / `--no-strip-wasm` flag that determins whether static symbols are kept in the resulting wasm file.

* Remove copy&past'ed code in the tests for wasm build tests

* Cleanup some artifacts code, now that we no longer use `wasm-opt` inside flutter tools
2024-02-15 22:05:18 +00:00
Kate Lovett ea3d066237
Reland simulatedAccessibilityTraversal fix (#143527)
Relands https://github.com/flutter/flutter/pull/143386
Which was reverted in https://github.com/flutter/flutter/pull/143523
Fixes https://github.com/flutter/flutter/issues/143173
Unblocks https://github.com/flutter/flutter/pull/143485

⭐ ➡️  Update from the revert is in this commit: 1e6853291e
2024-02-15 21:37:40 +00:00
Martin Kustermann 178898e45d
Disentangle and align flutter build web --wasm flags (#143517)
* Make `flutter build web` have one option that determins the
optimization level: `-O<level>` / `--optimization-level=<level>` =>
Defaulting to -O4 => Will apply to both dart2js and dart2wasm

* Deprecate `--dart2js-optimization=O<level>`

* Disentagle concept of optimization from concept of static symbols =>
Add a `--strip-wasm` / `--no-strip-wasm` flag that determins whether
static symbols are kept in the resulting wasm file.

* Remove copy&past'ed code in the tests for wasm build tests

* Cleanup some artifacts code, now that we no longer use `wasm-opt`
inside flutter tools
2024-02-15 21:39:58 +01:00
auto-submit[bot] d00fe8faae
Reverts "Fix and test SemanticsController.simulatedAccessibilityTraversal (#143386)" (#143523)
Reverts flutter/flutter#143386

Initiated by: Piinks

Reason for reverting: This broke a customer test.

Original PR Author: Piinks

Reviewed By: {goderbauer}

This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/143173

The `start` and `end` parameters of `SemanticsController.simulatedAccessibilityTraversal` were deprecated in https://github.com/flutter/flutter/issues/112413, but no tests were added that verified the new API. 😳

This change
- fixes a typo in an error message
- fixes the new `startNode` and `endNode` not being accounted for in setting the traversal range
- adds dart fixes for the deprecations
- adds tests for the new API that is meant to replace the deprecated one.
  - Filed https://github.com/flutter/flutter/issues/143405 to follow up on the new API not working in multiple views.
2024-02-15 15:49:26 +00:00
Hossein Yousefi 97ab92ee35
Modify plugin_ffi and package_ffi template (#143376)
* Use `dart run` instead of `flutter pub run` in the documentation as it is now deprecated.
* Use `int64_t` instead of `intptr_t` for `sum` examples.
2024-02-15 10:37:30 +00:00
auto-submit[bot] 0fac13b443
Reverts "[a11y] Add isEnabled semantics flag to text field (#143334)" (#143494)
Reverts flutter/flutter#143334

Initiated by: hangyujin

Reason for reverting: broke g3 tests

Original PR Author: hangyujin

Reviewed By: {LongCatIsLooong}

This change reverts the following previous change:
Original Description:
Add a semantics flag to   text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`)

internal: b/322345393
2024-02-14 22:43:18 +00:00
auto-submit[bot] eae0c6a357
Reverts "[a11y] Fix date picker cannot focus on the edit field (#143117)" (#143493)
Reverts flutter/flutter#143117

Initiated by: dnfield

Reason for reverting: made the tree red.

Original PR Author: hangyujin

Reviewed By: {QuncCccccc}

This change reverts the following previous change:
Original Description:
fixes: https://github.com/flutter/flutter/issues/143116
fixes: https://github.com/flutter/flutter/issues/141992

https://b.corp.google.com/issues/322173632
2024-02-14 22:17:18 +00:00
hangyu 846719ecaf
[a11y] Fix date picker cannot focus on the edit field (#143117)
fixes: [DatePicker edit field](https://github.com/flutter/flutter/issues/143116) 

https://b.corp.google.com/issues/322173632
2024-02-14 21:09:44 +00:00
Michael Goderbauer 3f09b23338
cleanup now-irrelevant ignores for deprecated_member_use (#143403)
Follow-up to https://github.com/flutter/flutter/pull/143347.
2024-02-14 21:08:25 +00:00
Kate Lovett f190d6259f
Fix and test SemanticsController.simulatedAccessibilityTraversal (#143386)
Fixes https://github.com/flutter/flutter/issues/143173

The `start` and `end` parameters of `SemanticsController.simulatedAccessibilityTraversal` were deprecated in https://github.com/flutter/flutter/issues/112413, but no tests were added that verified the new API. 😳

This change
- fixes a typo in an error message
- fixes the new `startNode` and `endNode` not being accounted for in setting the traversal range
- adds dart fixes for the deprecations
- adds tests for the new API that is meant to replace the deprecated one.
  - Filed https://github.com/flutter/flutter/issues/143405 to follow up on the new API not working in multiple views.
2024-02-14 20:48:36 +00:00
Qun Cheng 9bc839321d
The initial/selected item on popup menu should always be visible (#143118)
Fixes #142895

With the change of #143121, this PR is to add auto scroll to `PopupMenuButton` so when we open the menu, it will automatically scroll to the selected item.

https://github.com/flutter/flutter/assets/36861262/c2bc0395-0641-4e7a-a54d-57a8e62ee26f
2024-02-14 20:29:17 +00:00
Daco Harkes db83bc6e59
Roll native_assets_builder to 0.5.0 (#143472)
Roll of https://github.com/dart-lang/native/pull/964, which separates the `KernelAsset`s (the asset information embedded in the Dart kernel snapshot) from `Asset`s (the assets in the `build.dart` protocol). See the linked issue for why they ought to be different instead of shared.

This PR does not change any functionality in Flutter.

(Now that https://github.com/flutter/flutter/pull/143055 has landed, we can land breaking changes.)

For reference, the same roll in the Dart SDK: https://dart-review.googlesource.com/c/sdk/+/352642
2024-02-14 20:23:23 +00:00
Bruno Leroux 5b005e4791
InputDecorator M3 test migration step2 (#143369)
## Description

This PR is the second step for the M3 test migration for `InputDecorator` (step 1 was https://github.com/flutter/flutter/pull/142981).

This PR migrate the two first tests of the M2 section. Those were big tests. I splitted them in several testsn organized in groups, and I narrowed their scope when possible.

@justinmc  I did not move yet the M2 tests to a separate file (I move them to a group) because it would mean we loss the line history which is useful during the migration. In the next step, I will focus on moving out some tests that are in the 'Material2' group (the ones that are ok with both M2 and M3).

## Related Issue

Related to https://github.com/flutter/flutter/issues/139076

## Tests

Adds several tests for M3.
2024-02-14 20:10:21 +00:00
Bruno Leroux 5c88fbf0b9
Add more documentation for TextEditingController default constructor (#143452)
## Description

This PR adds more documentation for `TextEditingController(String text)` constructor and it adds one example.

https://github.com/flutter/flutter/pull/96245 was a first improvement to the documentation.
https://github.com/flutter/flutter/issues/79495 tried to hide the cursor when an invalid selection is set but it was reverted.
https://github.com/flutter/flutter/pull/123777 mitigated the issue of having a default invalid selection: it takes care of setting a proper selection when a text field is focused and its controller selection is not initialized.

I will try changing the initial selection in another PR, but It will probably break several existing tests.

## Related Issue

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

## Tests

Adds 1 test for the new example.
2024-02-14 20:10:18 +00:00
Gray Mackall c61dc2a586
Format all kotlin according to ktlint (#143390)
Entire pr generated with [ktlint](https://github.com/pinterest/ktlint) --format. First step before enabling linting as part of presubmit for kotlin changes.
2024-02-14 17:58:18 +00:00
Anas ca03beda4d
[tools] Add column header for emulators information (#142853)
Add column information as table header for `flutter emulators` command.

**Before:**

```
2 available emulators:

Pixel_3_API_30   • Pixel 3 API 30   • Google • android
Resizable_API_33 • Resizable API 33 • Google • android

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

You can find more information on managing emulators at the links below:
  https://developer.android.com/studio/run/managing-avds
  https://developer.android.com/studio/command-line/avdmanager
```

**After:**

```
2 available emulators:

Id               • Name             • Manufacturer • Platform

Pixel_3_API_30   • Pixel 3 API 30   • Google       • android
Resizable_API_33 • Resizable API 33 • Google       • android

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

You can find more information on managing emulators at the links below:
  https://developer.android.com/studio/run/managing-avds
  https://developer.android.com/studio/command-line/avdmanager
```

fixes #140656
2024-02-14 12:49:24 +00:00
Martin Kustermann abadf9ff8c
Use dart compile wasm for wasm compilations (#143298)
* Flags to `dart compile wasm`

Some options are not relevant to a standalone user of `dart compile
wasm` (e.g. specyfing dart-sdk, platform file etc). => Those aren't
offered by the `dart compile wasm` tool directly. => We use the
`--extra-compiler-option=` instead which passes through arbitrary
options to the dart2wasm compiler. => We don't maintain compatibility of
those options, if we update them we'll ensure to also update flutter
tools

* Binaryen optimization passes

This change will mean we use the binaryen flags from Dart SDK which are
slightly different from the ones in flutter.

* Optimization configuration

This change will also start using the more standardized `-O` flag for
determining optimization levels. The meaning of those flags have been
mostly aligned with dart2js (with some differences remaining).

* Minimization

Using the new optimization flags, namely `-O4` for `--wasm-opt=full`,
will automatically enable the new `--minify` support. Minification is
Dart semantics preserving but changes the `<obj>.runtimeType.toString()`
to use minified names (just as in dart2js).

* Code size changes

  Overall this change will reduce wonderous code size by around 10%.

Issue https://github.com/dart-lang/sdk/issues/54675
2024-02-14 11:15:14 +01:00
Andrew Kolos 14bcc694ff
Fix AssetsEntry::equals (#143355)
In service of https://github.com/flutter/flutter/issues/143348.

**Issue.** The `equals` implementation of `AssetsEntry` is incorrect. It compares `flavors` lists using reference equality. This PR addresses this.

This also adds a test to make sure valid asset `flavors` declarations are parsed correctly.

While we are here, this PR also includes a couple of refactorings:
  * `flutter_manifest_test.dart` is a bit large. To better match our style guide, I've factored out some related tests into their own file.
  *  A couple of changes to the `_validateListType` function in `flutter_manifest.dart`:
      * The function now returns a list of errors instead of accepting a list to append onto. This is more readable and also allows callers to know which errors were found by the call.
      * The function is renamed to `_validateList` and now accepts an `Object?` instead of an `YamlList`. If the argument is null, an appropriate error message is contained in the output. This saves callers that are only interested in validation from having to write their own null-check, which they all did before.
      * Some error strings were tweaked for increased readability and/or grammatical correctness.
2024-02-14 00:11:24 +00:00
Nate f01ce9f4cb
Have FocusManager respond to app lifecycle state changes (#142930)
fixes #87061

It doesn't matter whether I'm using Google Chrome, VS Code, Discord, or a Terminal window: any time a text cursor is blinking, it means that the characters I type will show up there.

And this isn't limited to text fields: if I repeatedly press `Tab` to navigate through a website, there's a visual indicator that goes away if I click away from the window, and it comes back if I click or `Alt+Tab` back into it.

<details open>
<summary>Example (Chrome):</summary>

![focus node](https://github.com/flutter/flutter/assets/10457200/bef42cd9-28e5-4214-b071-b7ef56b26609)

</details>

<details open>
<summary>This PR adds the same functionality to Flutter apps:</summary>

![Flutter demo](https://github.com/flutter/flutter/assets/10457200/6eb34c44-5fb0-4b27-aa10-6606a1eb187e)

</details>
2024-02-13 23:27:19 +00:00
Loïc Sharma b4270f7b06
Improve some scrollbar error messages (#143279)
Adds some missing spaces, rewords some errors, and splits some errors into more lines.
2024-02-13 22:46:56 +00:00
hangyu 14bce28f3c
[a11y] Add isEnabled semantics flag to text field (#143334)
Add a semantics flag to   text field to fix https://github.com/flutter/flutter/issues/143337 (in IOS the disabled text field is not read `dimmed`)

internal: b/322345393
2024-02-13 22:35:43 +00:00
Taha Tesser ccf42dde88
Introduce avatarBoxConstraints & deleteIconBoxConstraints for the chips (#143302)
fixes [Chip widget's avatar padding changing if label text is more than 1 line](https://github.com/flutter/flutter/issues/136892)

### Code sample

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

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

List<String> strings = [
  'hello good morning',
  'hello good morning hello good morning',
  'hello good morning hello good morning hello good morning'
];

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: Center(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: [
              Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  const Text(
                      'avatarBoxConstraints: null \ndeleteIconBoxConstraints: null',
                      textAlign: TextAlign.center),
                  for (String string in strings)
                    Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: RawChip(
                        label: Container(
                          width: 150,
                          color: Colors.amber,
                          child: Text(
                            string,
                            maxLines: 3,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                        avatar: const Icon(Icons.settings),
                        onDeleted: () {},
                      ),
                    ),
                ],
              ),
              Column(
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  const Text(
                      'avatarBoxConstraints: BoxConstraints.tightForFinite() \ndeleteIconBoxConstraints: BoxConstraints.tightForFinite()',
                      textAlign: TextAlign.center),
                  for (String string in strings)
                    Padding(
                      padding: const EdgeInsets.all(8.0),
                      child: RawChip(
                        avatarBoxConstraints:
                            const BoxConstraints.tightForFinite(),
                        deleteIconBoxConstraints:
                            const BoxConstraints.tightForFinite(),
                        label: Container(
                          width: 150,
                          color: Colors.amber,
                          child: Text(
                            string,
                            maxLines: 3,
                            overflow: TextOverflow.ellipsis,
                          ),
                        ),
                        avatar: const Icon(Icons.settings),
                        onDeleted: () {},
                      ),
                    ),
                ],
              ),
            ],
          ),
        ),
      ),
    );
  }
}

```

</details>

### Preview
![Screenshot 2024-02-12 at 14 58 35](https://github.com/flutter/flutter/assets/48603081/5724bd07-7ac7-4987-b992-fa3ab8488273)

# Example previews
![Screenshot 2024-02-12 at 22 15 14](https://github.com/flutter/flutter/assets/48603081/33af472d-3561-47d4-8d0d-e1628de1e0aa)
![Screenshot 2024-02-12 at 22 15 46](https://github.com/flutter/flutter/assets/48603081/3de78b59-5cb6-4fd8-879b-8e204aacb069)
2024-02-13 20:30:53 +00:00
Reid Baker a8e9f209a1
Update dependencies in integration test (#143111)
Update dependencies to latest versions
Related to #142618 
Fixes #143219

- [ x I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
2024-02-13 20:29:35 +00:00
Jackson Gardner 5a9fa1e7bf
Dual compile reland (#143262)
This is an attempt at a reland of https://github.com/flutter/flutter/pull/141396

The main changes here that are different than the original PR is fixes to wire up the `flutter test` command properly with the web renderer.
2024-02-13 20:02:10 +00:00
Andrew Kolos e8a75aa088
refactor: remove implicit globals dependencies in writeBundle (#143343)
This is in service of https://github.com/flutter/flutter/pull/141194

This will make it easier to get the `flutter run -d <browser>` and `flutter build fuschia` cases easier to get under test.
2024-02-13 19:38:37 +00:00
Matan Lurey 66367dd888
Remove message about pub cache that is not actionable (#143357)
... and neither the pub nor tools team think it's important.

Fixes https://github.com/flutter/flutter/issues/140628.
2024-02-13 11:15:15 -08:00
Taha Tesser 2adbc2b8ce
Fix chips constructor docs for callbacks (#143361)
fixes [ActionChip constructor documentation does not match class documentation](https://github.com/flutter/flutter/issues/137964)
2024-02-13 19:09:42 +00:00
Nate 8eea4f175f
Implementing switch expressions in widgets/ (#143293)
This PR is the 7ᵗʰ step in the journey to solve issue #136139 and make the entire Flutter repo more readable.

(previous pull requests: #139048, #139882, #141591, #142279, #142634, #142793)

This pull request covers everything in `packages/flutter/lib/src/widgets/`. Most of it should be really straightforward, but there was some refactoring in the `getOffsetToReveal()` function in `two_dimensional_viewport.dart`. I'll add some comments to describe those changes.
2024-02-13 18:51:03 +00:00
Gray Mackall 8ba086a277
[Re-re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions (#143341)
This is a direct revert of (the revert of (the reland of (the policy pr))): https://github.com/flutter/flutter/pull/143132. 

The only change is:
1. to put a conditional all on one line, because the packages repository has a test that uses an old flutter project to make sure nothing regresses. The old project uses an old gradle version, and the old gradle version bundles an old groovy version, and the old groovy version has a bug where lines that start with `&&` don't always work: https://issues.apache.org/jira/browse/GROOVY-7218 (I enjoy that the revert reason ends up providing another strong justification to go forward with the policy). Also thanks to @reidbaker for pointing out this bug.
2. I also made a slight formatting change to the messages that print when out of the support bounds, which I think looks slightly better.

I tested this with on a branch that included a revert of https://github.com/flutter/flutter/pull/142008, and was able to recreate the failure and verify that it was resolved by 1).
2024-02-13 15:44:17 +00:00
Taha Tesser 1f8d110b8f
Fix InputDecorators suffix and prefix widgets are tappable when hidden (#143308)
fixes [The InputDecoration's suffix and prefix widget can be tapped even if it does not appear](https://github.com/flutter/flutter/issues/139916)

This PR also updates two existing tests to pass the tests for this PR. These tests are trying to tap prefix and  suffix widgets when they're hidden. While the linked issue had visible prefix and suffix widgets https://github.com/flutter/flutter/issues/39376 for reproduction.

### Code sample

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

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

void main() {
  runApp(MainApp());
}

class MainApp extends StatelessWidget {
  final _messangerKey = GlobalKey<ScaffoldMessengerState>();

  MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      scaffoldMessengerKey: _messangerKey,
      home: Scaffold(
        body: Container(
          alignment: Alignment.center,
          padding: const EdgeInsets.all(16.0),
          child: TextField(
            decoration: InputDecoration(
              labelText: 'Something',
              prefix: GestureDetector(
                onTap: () {
                  _messangerKey.currentState?.showSnackBar(
                      const SnackBar(content: Text('A tap has occurred')));
                },
                child: const Icon(Icons.search),
              ),
              suffix: GestureDetector(
                onTap: () {
                  _messangerKey.currentState?.showSnackBar(
                      const SnackBar(content: Text('A tap has occurred')));
                },
                child: const Icon(Icons.search),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
```

</details>

### Before
![ScreenRecording2024-02-12at18 40 34-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/c101e0d6-ce5a-4b28-9626-28bcb83d2a5c)

### After
![ScreenRecording2024-02-12at18 40 10-ezgif com-video-to-gif-converter](https://github.com/flutter/flutter/assets/48603081/923b348e-8adf-4d64-9dc3-e75d30e3e2fb)
2024-02-13 08:48:18 +00:00
Tirth e93a10d1fb
Pass-Through inputFormatters in DropdownMenu (#143250)
Pass-Through `inputFormatters` in `DropdownMenu`.

Fixes: #142374
2024-02-13 03:57:15 +00:00
Taha Tesser d271791e8c
Fix insetPadding parameter nullability for dialogs (#143305)
fixes [`insetPadding` should be nullable in dialogs](https://github.com/flutter/flutter/issues/117125)
2024-02-13 00:12:02 +00:00
Camille Simon 0650b76884
Revert "Migrate integration_test plugin to Gradle Kotlin DSL (#142008)" (#143329)
This reverts https://github.com/flutter/flutter/pull/142008 because it broke the Flutter --> packages roller.
2024-02-12 23:26:18 +00:00
Ross Llewallyn 525cffd717
Badge class doc typo - missing [ (#143318)
Doc typo fix

No issue made
2024-02-12 23:24:41 +00:00
Kevin Moore e1645b150f
[web] Move JS interop to extension types (#143274)
Now that we can bump the min SDK to latest.
2024-02-12 11:14:10 -08:00
Valentin Vignal 52f923c360
Add documentation for best practices for StreamBuilder like FutureBuilder (#143295)
Fixes https://github.com/flutter/flutter/issues/142189
2024-02-12 18:25:57 +00:00
Nitesh Sharma 49f620d8ea
Fix dual focus issue in CheckboxListTile, RadioListTile and SwitchListTile (#143213)
These widgets can now only receive focus once when tabbing through the focus tree.
2024-02-12 10:07:51 -08:00
Reid Baker ace3e58f0a
Revert "[Re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (#143314)
Reverts flutter/flutter#143132
2024-02-12 18:04:05 +00:00
Jenn Magder 1d25b0c700
Update integration_test iOS FTL README script to remove targeted version (#143248)
1. Remove `dev_target` from suggested Firebase Test Lab iOS script and use wildcard instead.
2. First run `flutter clean` before building to avoid collisions between runs.
3. Use `zip --must-match` in case the xctestrun or `Release-iphoneos` directories are missing (like ran with `--profile` instead of `--release` on purpose) to fail instead of zipping up only part of what's needed.

This came out of a discussion with FTL about these instructions and I tried to run them locally and avoided setting `dev_target`.

See also #74428
2024-02-12 17:53:05 +00:00
Tirth 10442399fb
Introduce iconAlignment for the buttons with icon (#137348)
Adds `iconAlignment` property to `ButtonStyleButton` widget.

Fixes #89564

### Example

https://github.com/flutter/flutter/assets/13456345/1b5236c4-5c60-4915-b3c6-0a56c43f8a19
2024-02-12 17:08:20 +00:00
LongCatIsLooong bc49cf8091
Fix text painter longest line resizing logic for TextWidthBasis.longestLine (#143024)
Fixes https://github.com/flutter/flutter/issues/142309.
2024-02-10 23:39:20 +00:00
Polina Cherkasova b48dfca382
Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08:00
Kris Pypen 2f117c545b
Fix: performance improvement on golden test comparison (#142913)
During golden test image comparison 2 lists of a different type are compared with the method "identical", so this will never be true. The test image is a _Uint8ArrayView while the master image is an Uint8List. So that results in always a heavy computation to get the difference between the test and the master image.

When you run this test snippet I go from 51 seconds to 14 seconds:
```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

void main() {
  for (int i = 0; i < 100; i++) {
    testWidgets('Small test', (WidgetTester tester) async {
      await tester.pumpWidget(Directionality(textDirection: TextDirection.ltr, child: Text('jo')));
      await expectLater(find.byType(Text), matchesGoldenFile('main.png'));
    });
  }
}
```
2024-02-09 22:05:00 +00:00
Nate 1887bc410f
Implementing switch expressions in lib/src/material/ (#142793)
This PR is the 6ᵗʰ step in the journey to solve issue #136139 and make the entire Flutter repo more readable.

(previous pull requests: #139048, #139882, #141591, #142279, #142634)

The current focus is on `packages/flutter/lib/src/material/`. The previous 2 PRs covered files in this directory starting with letters `a-m`; this one takes care of everything else.
2024-02-09 22:03:23 +00:00
Henry Riehl fa71e8029b
Add position data to OnDragEnd callback (#140378)
This PR adds localPosition/globalPosition data to the `DragEndDetails`
argument of the `onDragEnd` callback.
2024-02-09 12:37:20 -08:00
Jenn Magder 2fc19619e8
Set plugin template minimum iOS version to 12.0 (#143167)
Fixes https://github.com/flutter/flutter/issues/140474

See https://github.com/flutter/flutter/pull/122625 where this was done 11->12.
2024-02-09 18:32:10 +00:00
Bartek Pacia 60f30a65b4
Migrate integration_test plugin to Gradle Kotlin DSL (#142008)
We already have a simple app in this repo that fully uses Gradle Kotlin DSL (see #141541). The next small step is to have at least one plugin that also uses Gradle Kotlin DSL. Let's use `integration_test` for that, since it's versioned with Flutter SDK.
2024-02-09 18:07:56 +00:00
David Martos f0bb9d57e6
barrierColor property in DialogTheme (#142490) 2024-02-09 01:50:14 -08:00
Michael Goderbauer 0aa9b5e17d
Layout animated GIFs only once (#143188)
Fixes https://github.com/flutter/flutter/issues/138610.

When `RenderImage` receives a new `Image` it only needs to fire up the layout machinery when the dimensions of the image have changed compared to the previous image. If the dimensions are the same, a repaint is sufficient.
2024-02-09 01:12:06 +00:00
Gustl22 2299ec781f
Set default flutter source directory for gradle builds (#142934)
See [#142498](https://github.com/flutter/flutter/pull/142498#discussion_r1478602032)
See this discussion: https://discord.com/channels/608014603317936148/1186378330178601000
2024-02-08 22:28:39 +00:00
Gray Mackall 4b0abc7771
[Re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions (#143132)
Re land of https://github.com/flutter/flutter/pull/142000. 
Differences:
1. Fixed the test that was failing in postsubmit. The reason was that the Flutter Gradle Plugin was being applied after KGP in that test, so we couldn't find the KGP version. This caused a log, and the test expects no logs. I moved FGP to after KGP
2. Added to the logs for when we can't find AGP. Change is from
>  "Warning: unable to detect project AGP version. Skipping version checking."

to 
> ~"Warning: unable to detect project AGP version. Skipping version checking. \nThis may be because you have applied the Flutter Gradle Plugin after AGP."~

update: the above is wrong, changed to 
> "Warning: unable to detect project KGP version. Skipping version checking. \nThis may be because you have applied AGP after the Flutter Gradle Plugin."

3. Added a note to the app-level build.gradle templates that FGP must go last
> // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugin.
2024-02-08 22:10:58 +00:00
Jackson Gardner 2efeeb47bc
Revert Dual Web Compile changes (#143175)
Dual Web Compile has had some issues where `flutter test` is not respecting the `--web-renderer` flag for some reason. I haven't gotten entirely to the bottom of the issue, but for now we need to rever these changes while I investigate. This reverts the following PRs:

https://github.com/flutter/flutter/pull/143128
https://github.com/flutter/flutter/pull/141396

While doing this revert, I had a few merge conflicts with https://github.com/flutter/flutter/pull/142760, and I tried to resolve the merge conflicts within the spirit of that PR's change, but @chingjun I might need your input on whether the imports I have modified are okay with regards to the change you were making.
2024-02-08 21:45:09 +00:00
Michael Goderbauer 8d3c7b6f6a
Cross-link SliverFixedExtentList/SliverPrototypeExtentList/SliverVariedExtentList (#143184)
Fixes https://github.com/flutter/flutter/issues/141678.
2024-02-08 21:45:06 +00:00
Zachary Anderson fbc9f2d5bf
[flutter_tool] Retry a gradle build on connection timeout (#143084)
This PR will likely not help with the issue on our CI discussed in
https://github.com/flutter/flutter/issues/142637, but will do one retry
for our users if they hit the same issue.
2024-02-08 12:39:00 -08:00
Qun Cheng cc4abe92fb
Correct menu position when menu is constrained (#143121)
Fixes #142896

The original code below is to always place the selected item above(overlap) the popup button so that the selected item can always be visible: f8a77225f3/packages/flutter/lib/src/material/popup_menu.dart (L723-L732)

But when menu height is constrained and the menu itself is super long, the selected item still assumes there is enough space to push up all the items whose index is smaller than the selected index. As a result, every time when the menu is open, the calculation provides a different result to be the offset for the selected index,  and then with a constrained height, the menu looks jumping all over the place based on the different selected index.

https://github.com/flutter/flutter/assets/36861262/ad761f95-0ff5-4311-a81d-dac56df879c5

Even though the original calculation is to make the selected item visible when open the menu, the menu doesn't auto scroll and only expands itself as much as possible to show the selected one. In this case, if the screen it too small to show the selected item, we still cannot see it. This can be fixed by using `Scrollable.ensureVisible()`(#143118).

So we remove the calculation in this PR and the menu will always show up based on the top left of the anchor(button).

https://github.com/flutter/flutter/assets/36861262/03272f26-9440-4ac4-a701-9a0b41776ff9
2024-02-08 20:36:24 +00:00
Daco Harkes 4e70bfae2b
Reland "Move native assets to isolated/ directory" (#143055)
Reland of https://github.com/flutter/flutter/pull/142709.

The revert of the revert is in the first commit, the fix in the commit on top.

The move of the fakes for packages/flutter_tools/test/general.shard/resident_runner_test.dart was erroneous before, as it was trying to use setters instead of a private field. This PR changes the private `_devFS` field in the fake to be a public `fakeDevFS` in line with other fakes.

## Original PR description

Native assets in other build systems are not built with `package:native_assets_builder` invoking `build.dart` scripts. Instead all packages have their own blaze rules. Therefore we'd like to not depend on `package:native_assets_builder` from flutter tools in g3 at all.

This PR aims to move the imports of `native_assets_builder` and `native_assets_cli` into the `isolated/` directory and into the files with a `main` function that are not used in with other build systems.

In order to be able to remove all imports in files used by other build systems, two new interfaces are added `HotRunnerNativeAssetsBuilder` and `TestCompilerNativeAssetsBuilder`. New parameters are then piped all the way through from the entry points:

* bin/fuchsia_tester.dart
* lib/executable.dart

The build_system/targets dir is already excluded in other build systems.

So, after this PR only the two above files and build_system/targets import from `isolated/native_assets/` and only `isolated/native_assets/` import `package:native_assets_cli` and `package:native_assets_builder`.

Context:

* https://github.com/flutter/flutter/issues/142041
2024-02-08 17:49:48 +00:00
Bartek Pacia deaa600204
Reland "Update gradle lockfiles template (#140115)" (#143081)
Trying to reland #140115 which I had to revert in #142889 because [it broke the tree](https://github.com/flutter/flutter/pull/140115#issuecomment-1925774719).

In this PR I fixed the post-submit following tests:
2024-02-08 16:22:15 +00:00
Jackson Gardner 71c6cd0cb9
Pass along web renderer into debugging options in the test command. (#143128)
We need to pass along the web renderer in the debugging options to make sure that the resident web runner sets up the targets correctly.
2024-02-08 01:21:07 +00:00
Qun Cheng d85497d91b
Add a unit test for NavigationRail (#143108)
Adding `SingleChildScrollView` to `NavigationRail` may cause exception if the nav rail has some expanded widgets inside, like the issue: https://github.com/flutter/flutter/issues/143061. This PR is just to add a unit test to avoid causing this breaking again.
2024-02-07 23:14:56 +00:00
auto-submit[bot] cc4e07954d
Reverts "Improve build output for all platforms" (#143125)
Reverts flutter/flutter#128236

Initiated by: vashworth

Reason for reverting: Causing `Mac_pixel_7pro run_release_test` and `Mac_arm64_android run_release_test` to fail: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_pixel_7pro%20run_release_test/547/overview 
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64_android%20run_release_test/10516/overview

Original PR Author: guidezpl

Reviewed By: {christopherfujino, loic-sharma}

This change reverts the following previous change:
Original Description:
Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-02-07 22:44:19 +00:00
Pierre-Louis 2fceeb0e3c
Improve build output for all platforms (#128236)
Improves the build output:

1. Gives confirmation that the build succeeded, in green
1. Gives the path to the built executable, without a trailing period to make it slightly easier to cmd/ctrl+open
1. Gives the size of the built executable (when the built executable is self contained) 

### `apk`, `appbundle` 

<img width="607" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ecc52abe-cd2e-4116-b22a-8385ae3e980d">

<img width="634" alt="image" src="https://github.com/flutter/flutter/assets/6655696/8af8bd33-c0bd-4215-9a06-9652ee019436">

### `macos`, `ios`, `ipa`
Build executables are self-contained and use a newly introduced `OperatingSystemUtils.getDirectorySize`.

<img width="514" alt="image" src="https://github.com/flutter/flutter/assets/6655696/b5918a69-3959-4417-9205-4f501d185257">

<img width="581" alt="image" src="https://github.com/flutter/flutter/assets/6655696/d72fd420-18cf-4470-9e4b-b6ac10fbcd50">

<img width="616" alt="image" src="https://github.com/flutter/flutter/assets/6655696/5f235ce1-252a-4c13-898f-139f6c7bc698">

### `windows`, `linux`, and `web`
Build executables aren't self-contained, and folder size can sometimes overestimate distribution size, therefore their size isn't mentioned (see discussion below).

<img width="647" alt="image" src="https://github.com/flutter/flutter/assets/6655696/7179e771-1eb7-48f6-b770-975bc073437b">

<img width="658" alt="image" src="https://github.com/flutter/flutter/assets/6655696/a6801cab-7b5a-4975-a406-f4c9fa44d7a2">

<img width="608" alt="image" src="https://github.com/flutter/flutter/assets/6655696/ee7c4125-a273-4a65-95d7-ab441edf8ac5">

### Size reporting
When applicable, the printed size matches the OS reported size.

- macOS
    <img width="391" alt="image" src="https://github.com/flutter/flutter/assets/6655696/881cbfb1-d355-444b-ab44-c1a6343190ce">
- Windows
    <img width="338" alt="image" src="https://github.com/flutter/flutter/assets/6655696/3b806def-3d15-48a9-8a25-df200d6feef7">
- Linux   
    <img width="320" alt="image" src="https://github.com/flutter/flutter/assets/6655696/89a4aa3d-2148-4f3b-b231-f93a057fee2b">

## Related issues
Part of #120127
Fixes https://github.com/flutter/flutter/issues/121401
2024-02-07 22:22:25 +00:00
yim 16e7218cd4
Fixed cursor blinking during selection. (#141380)
The cursor now correctly stops blinking while it's being interacted with.
2024-02-07 13:39:30 -08:00
auto-submit[bot] d60643e82f
Reverts "Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (#143114)
Reverts flutter/flutter#142000

Initiated by: vashworth

Reason for reverting: Causing `Mac_pixel_7pro run_release_test` and `Mac_arm64_android run_debug_test_android` to fail: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_pixel_7pro%20run_release_test/539/overview
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_arm64_android%20run_debug_test_android/6682/overview

Original PR Author: gmackall

Reviewed By: {reidbaker, camsim99, bartekpacia}

This change reverts the following previous change:
Original Description:
Policy per https://flutter.dev/go/android-dependency-versions.

https://github.com/flutter/flutter/issues/140913

~Still a WIP while I clean up some error handling, remove some prints, and figure out a Java test (more difficult than the others because I believe we can only install one java version per ci shard).~

~Also it looks like there are errors that I need to fix when this checking is applied to a project that uses the old way of applying AGP/KGP using the top-level `build.gradle` file (instead of the new template way of applying them in the `settings.gradle` file).~ Done, this is why [these lines exist](9af6bae6b9/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy (L72-L88)) in `flutter.groovy`. They just needed to be added
2024-02-07 21:22:26 +00:00
Gray Mackall 337bc79b0c
Enforce a policy on supported Gradle, Java, AGP, and KGP versions (#142000)
Policy per https://flutter.dev/go/android-dependency-versions.

https://github.com/flutter/flutter/issues/140913

~Still a WIP while I clean up some error handling, remove some prints, and figure out a Java test (more difficult than the others because I believe we can only install one java version per ci shard).~

~Also it looks like there are errors that I need to fix when this checking is applied to a project that uses the old way of applying AGP/KGP using the top-level `build.gradle` file (instead of the new template way of applying them in the `settings.gradle` file).~ Done, this is why [these lines exist](9af6bae6b9/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy (L72-L88)) in `flutter.groovy`. They just needed to be added
2024-02-07 20:56:07 +00:00
Jackson Gardner 2aef6c570c
Fix inputs and outputs for WebReleaseBundle (#143023)
Since `WebReleaseBundle` is responsible for copying over the outputs from the subtargets, so it needs to be reflected in inputs and outputs so that things will be recopied when something changes.
2024-02-07 20:00:02 +00:00
Ian Hickson 9fccb32a58
Various improvements to text-editing-related documentation. (#142561) 2024-02-07 19:58:06 +00:00
Michael Goderbauer 4becae25b0
Revert "Add SingleChildScrollView for NavigationRail" (#143097)
Reverts flutter/flutter#137415

Reverting due to https://github.com/flutter/flutter/issues/143061. this is breaking some existing use cases, see also https://github.com/flutter/samples/pull/2157. If we try this again, we need to add this in less breaking way.

Fixes https://github.com/flutter/flutter/issues/143061
2024-02-07 19:30:02 +00:00
Gray Mackall 120a01ccd2
Restore log dumps for gradle OOM crashes, and set a value for MaxMetaspaceSize (#143085)
Re-sets two jvmargs that were getting cleared because we set a value for `-Xmx`. Could help with https://github.com/flutter/flutter/issues/142957. Copied from comment here https://github.com/flutter/flutter/issues/142957:
>Two random things I ran into while looking into this that might help:
>
>1. Gradle has defaults for a couple of the jvmargs, and setting any one of them clears those defaults for the others (bug here https://github.com/gradle/gradle/issues/19750). This can cause the "Gradle daemon to consume more and more native memory until it crashes", though the bug typically has a different associated error. It seems worth it to re-set those defaults.
>2. There is a property we can set that will give us a heap dump on OOM ([-XX:HeapDumpOnOutOfMemoryError](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/clopts001.html))

Mostly just a find and replace from `find . -name gradle.properties -exec sed -i '' 's/\-Xmx4G/-Xmx4G\ \-XX:MaxMetaspaceSize=2G\ \-XX:+HeapDumpOnOutOfMemoryError/g' {} \;`, with the templates and the one test that writes from a string replaced by hand. I didn't set a value for `MaxMetaspaceSize` in the template files because I want to make sure this value doesn't cause problems in ci first (changes to the templates are essentially un-revertable for those who `flutter create` while the changes exist).
2024-02-07 19:25:39 +00:00
Ian Hickson 1699ff38fe
Add a test for the isAvailableForEnvironment logic (#142251)
This is part 3 of a broken down version of the #140101 refactor.

There's some TODOs showing where I think we should change the behaviour, but in this PR the behaviour is unchanged.
A future PR will remove the tests that are redundant with these tests, but I wanted to make sure we had both sets in the codebase at the same time first.
This PR includes a change to the golden control test so that we can verify that these specific values do work on main. It would be extremely surprising if not, but in the interests of rigour...
2024-02-07 19:01:48 +00:00
Valentin Vignal ab836a2db0
Add the number of mismatched pixels to golden tests output (#142975)
Fixes https://github.com/flutter/flutter/issues/141036
2024-02-07 18:59:57 +00:00
Michael Goderbauer 0202e3bf7a
Add indexInParent to SemanticsNode debug information (#142826)
https://github.com/flutter/flutter/issues/93232
2024-02-07 18:51:04 +00:00
Andrew Kolos 34c2080b9d
Remove redundant rootDirectoryPath parameter in DevFS::update (#143034)
Resolves #143041
2024-02-07 18:04:31 +00:00
maRci002 8e2da8414c
Handle transitions to AppLifecycleState.detached in lifecycle state generation (#142523)
Generates the correct lifecycle state transitions in ServicesBinding when detaching.
2024-02-07 10:01:22 -08:00
Bruno Leroux 6a7baf573e
Fix M3 text field height + initial step for input decorator M3 test migration (#142981)
## Description

This PR main purpose is to make progress on the M3 test migration for `InputDecorator` (see https://github.com/flutter/flutter/issues/139076).

Before this PR more than 80 of the 156 tests defined in `input_decorator_test.dart` fail on M3.
Migrating all those tests in one shot is not easy at all because many failures are related to wrong positionning due to M3 typography changes. Another reason is that several M3 specific changes are required in order to get a proper M3 compliant text field, for instance:
- https://github.com/flutter/flutter/issues/142972
- https://github.com/flutter/flutter/issues/141354

Most of the tests were relying on an helper function (`buildInputDecorator`) which had a `useMaterial3` parameter. Unfortunately when `useMaterial3: true `was passed to this function it forced `useMaterial3: false` at the top level but overrided it at a lower level, which was very misleading because people could assume that the tests are ok with M3 (but in fact they were run using M2 typography but have some M3 logic in use).
I considered various way to make this change and I finally decided to run all existing tests only on M2 for the moment. Next step will be to move most of those tests to M3. In this PR, I migrated two of these existing tests for illustration.

Because many of the existing tests are checking input decorator height, I think it would also make sense to fix https://github.com/flutter/flutter/issues/142972 first. That's why I choosed to include a fix to https://github.com/flutter/flutter/issues/142972 in this PR.

A M3 filled `TextField` on Android:

| Before this PR | After this PR |
|--------|--------|
| ![image](https://github.com/flutter/flutter/assets/840911/403225b7-4c91-4aee-b19c-0490447ae7e3) | ![image](https://github.com/flutter/flutter/assets/840911/e96cf786-a9f5-4e15-bcdd-078350ff1608) | 

## Related Issue

Fixes https://github.com/flutter/flutter/issues/142972
Related to https://github.com/flutter/flutter/issues/139076

## Tests

Updates many existing tests 
+ adds 2 tests related to the fix for https://github.com/flutter/flutter/issues/142972
+ adds 1 tests for the M3 migration
+ move 1 tests related to M3
2024-02-07 13:57:21 +00:00
Taha Tesser c539ded64b
[reland] Add AnimationStyle to showSnackBar (#143052)
[Original was reverted due to uncaught analysis failure 
](https://github.com/flutter/flutter/pull/142825#issuecomment-1930620085)

---

fixes [`showSnackBar` is always replacing `animation` parameter of `SnackBar`](https://github.com/flutter/flutter/issues/141646)

### Code sample preview

![Screenshot 2024-02-02 at 21 10 57](https://github.com/flutter/flutter/assets/48603081/66d808f0-d638-4561-b9a4-96d1b93938f4)
2024-02-07 10:26:27 +00:00
Jason Simmons db141ecd28
Copy the flutter version JSON file into the simulated Flutter SDK used by update_packages (#143035)
Dart pub now expects that file to be present in a Flutter SDK (see
https://dart.googlesource.com/pub/+/dce232ec195df802a730eb3a66163e28d2ec6444)
2024-02-06 20:00:08 -08:00
Dan Field 7514c16a6a
Dispose precached image info (#143017)
`precacheImage` was failing to dipose the `ImageInfo` it receives. That's part of the contract of being an image listener.

I'm doing this in the frame callback for the same reason as evicting it from the cache.
2024-02-07 03:28:06 +00:00
Polina Cherkasova ac5c3dec87
Instrument CurvedAnimation. (#143007) 2024-02-07 03:26:40 +00:00
Andrew Brampton 10f1e63579
Update _goldens_io.dart to generate failure images during a size mism… (#142177)
Update the `matchesGoldenFile()` / `LocalComparisonOutput` code to generate failure images for golden tests that fail when the image sizes do not match. This can make it far quicker to identify what is wrong with the test image.

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

- [ x I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
2024-02-07 03:23:29 +00:00
auto-submit[bot] 310a7edbca
Reverts "Activate InkSparkle on CanvasKit" (#143036)
Reverts flutter/flutter#138545

Initiated by: zanderso

Reason for reverting: Failing in post-submit: https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20web_long_running_tests_5_5/14975/overview

```
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following FormatException was thrown running a test:
Invalid Shader Data

When the exception was thrown, this was the stack:
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.da

Original PR Author: bleroux

Reviewed By: {Piinks}

This change reverts the following previous change:
Original Description:
## Description

This PR activates the M3 `InkSparkle` splash animation on Android + CanvasKit.
Before it `InkSparkle` was only activated on native Android.

## Related Issue

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

## Tests

Updates several existing tests.
2024-02-07 02:44:21 +00:00
Bruno Leroux 7f811fb444
Activate InkSparkle on CanvasKit (#138545)
## Description

This PR activates the M3 `InkSparkle` splash animation on Android + CanvasKit.
Before it `InkSparkle` was only activated on native Android.

## Related Issue

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

## Tests

Updates several existing tests.
2024-02-07 00:28:04 +00:00
Chris Bracken 9f8fe3f04c
[Windows] Fix signed/unsigned int comparison (#142341)
Previously, we were comparing the signed int `target_length` (returned by WideCharToMultiByte) to a size_t string length, resulting in a signed/unsigned comparison warning as follows:

```
windows\runner\utils.cpp(54,43): warning C4018:  '>': signed/unsigned mismatch
```

WideCharToMultiByte returns:
* 0 on error
* the number of bytes written to the buffer pointed to by its fifth parameter, lpMultiByteStr, on success.

As a result it's safe to store the return value in an unsigned int, which eliminates the warning.

No changes to tests since this is dependent on end-user project settings/modifications and does not trigger a warning with default project settings.

Fixes: https://github.com/flutter/flutter/issues/134227
2024-02-07 00:09:57 +00:00
auto-submit[bot] ceca606662
Reverts "Move native assets to isolated/ directory" (#143027)
Reverts flutter/flutter#142709

Initiated by: vashworth

Reason for reverting: `Mac tool_tests_general` started failing on this commit: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20tool_tests_general/15552/overview

Original PR Author: dcharkes

Reviewed By: {christopherfujino, chingjun, reidbaker}

This change reverts the following previous change:
Original Description:
Native assets in other build systems are not built with `package:native_assets_builder` invoking `build.dart` scripts. Instead all packages have their own blaze rules. Therefore we'd like to not depend on `package:native_assets_builder` from flutter tools in g3 at all.

This PR aims to move the imports of `native_assets_builder` and `native_assets_cli` into the `isolated/` directory and into the files with a `main` function that are not used in with other build systems.

In order to be able to remove all imports in files used by other build systems, two new interfaces are added `HotRunnerNativeAssetsBuilder` and `TestCompilerNativeAssetsBuilder`. New parameters are then piped all the way through from the entry points:

* bin/fuchsia_tester.dart
* lib/executable.dart

The build_system/targets dir is already excluded in other build systems.

So, after this PR only the two above files and build_system/targets import from `isolated/native_assets/` and only `isolated/native_assets/` import `package:native_assets_cli` and `package:native_assets_builder`.

Context:

* https://github.com/flutter/flutter/issues/142041
2024-02-07 00:01:18 +00:00
Simon Friis Vindum 2911bfb84c
Make destructiveRed a CupertinoDynamicColor (#141364)
`destructiveRed` is an alias for `systemRed`, but, in the definition, the precise type information is lost.

This PR gives `destructiveRed` the type `CupertinoDynamicColor` (and not the superclass `Color`) like all the other colors defined in this file.
2024-02-06 21:26:52 +00:00
Daco Harkes a069e62e8a
Move native assets to isolated/ directory (#142709)
Native assets in other build systems are not built with `package:native_assets_builder` invoking `build.dart` scripts. Instead all packages have their own blaze rules. Therefore we'd like to not depend on `package:native_assets_builder` from flutter tools in g3 at all.

This PR aims to move the imports of `native_assets_builder` and `native_assets_cli` into the `isolated/` directory and into the files with a `main` function that are not used in with other build systems.

In order to be able to remove all imports in files used by other build systems, two new interfaces are added `HotRunnerNativeAssetsBuilder` and `TestCompilerNativeAssetsBuilder`. New parameters are then piped all the way through from the entry points:

* bin/fuchsia_tester.dart
* lib/executable.dart

The build_system/targets dir is already excluded in other build systems.

So, after this PR only the two above files and build_system/targets import from `isolated/native_assets/` and only `isolated/native_assets/` import `package:native_assets_cli` and `package:native_assets_builder`.

Context:

* https://github.com/flutter/flutter/issues/142041
2024-02-06 20:59:49 +00:00
Callum Moffat 1aa6ff5614
Fix CupertinoPageScaffold resizeToAvoidBottomInset (#142776)
Need to create a `MediaQuery` to expose the fact that the `viewInsets` have been consumed.

Fixes #142775
2024-02-06 20:57:53 +00:00