Commit Graph

1893 Commits

Author SHA1 Message Date
flutter-pub-roller-bot
1e3a200637
Roll pub packages (#152956)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-06 21:08:55 +00:00
flutter-pub-roller-bot
772bf44691
Roll pub packages (#152945)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-06 19:08:37 +00:00
Kevin Moore
3612ba1fce
Manual dependency bump (#152881)
`package:collection` is 50+ days behind at this point which is blocking updates to a number of other packages `http_parser`, `shelf`, etc...
2024-08-06 02:40:27 +00:00
flutter-pub-roller-bot
51646d091b
Roll pub packages (#152127)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-08-05 20:14:23 +00:00
Matan Lurey
97996b07a2
Use print logging on LUCI. (#152776)
Work around https://github.com/flutter/flutter/issues/152775 diagnosing https://github.com/flutter/flutter/issues/152769.
2024-08-02 23:21:18 +00:00
Matan Lurey
4ff9462be8
Fix local testing, gradle XML errors, and enable on CI. (#152383)
TIL you cannot have XML comments before the initial `<?xml` declaration.

Follow-up to https://github.com/flutter/flutter/pull/152326.
2024-08-01 09:10:45 -07:00
Greg Spencer
b05c2fad0c
Add find.backButton finder and StandardComponentType enum to find components in tests. (#149349)
## Description

This adds `find.backButton()` in the Common Finders to allow finding different types of standard UI elements. It works by attaching a key made from an enum value in a new enum called `StandardComponentType` to all of the standard widgets that perform the associated function.

I also substituted the finder in several places where it is useful in tests.

This allows writing tests that want to find the "back" button without having to know exactly which icon the back button uses under what circumstances.  To do it correctly is actually quite complicated, since there are several adaptations that occur (based on platform, and whether it is web or not).

## Tests
 - Added tests.
2024-07-30 01:29:31 +00:00
Matan Lurey
7f8ad8a4cb
Add and use an integration test with native(ADB) screenshots (#152326)
Closes https://github.com/flutter/flutter/issues/152325.

This PR is large due to generate `flutter create --platforms android`. A quick summary:

- Moves the integration test from `packages/flutter_driver/test` to `dev/integration_tests`
- Created a sample Flutter app that draws a blue rectangle
- Forked a subset of `package:flutter_goldens` that will work on the standalone Dart VM
- Forked a subset of `goldens.dart` (from `flutter_test`) to `src/native/goldens.dart` (i.e. `matchesGoldenFile`)

This ... works locally, but as usual I have no idea if it will work on Skia Gold so let's roll some dice.
2024-07-26 16:09:29 +00:00
Jackson Gardner
8f0e77696f
Set dart defines properly while in debug mode. (#152262)
Turns out just supporting the right value for `kDebugMode` was a lot simpler than I thought. Debug builds used to never go through the build system code path when using `flutter run`, but now that we have wasm this can occur with the run command.

This should address https://github.com/flutter/flutter/issues/148850
2024-07-25 22:00:50 +00:00
flutter-pub-roller-bot
89c88ae8e8
Roll pub packages (#151992)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-19 10:11:32 +00:00
flutter-pub-roller-bot
8c17a747c9
Roll pub packages (#151946)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-18 10:57:41 +00:00
flutter-pub-roller-bot
1d816f58cb
Roll pub packages (#151904)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-18 09:52:29 +00:00
flutter-pub-roller-bot
bed034add2
Roll pub packages (#151816)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-16 12:34:24 +00:00
Daco Harkes
da48b34f50
[native_assets] Roll deps (#151662)
Roll deps to address:

* https://github.com/dart-lang/native/issues/1256

Cross-linking Dart standalone CL: https://dart-review.googlesource.com/c/sdk/+/375461 (no breaking API changes)
2024-07-13 05:37:24 +00:00
Chris Bracken
68f375fe38
[macOS] support secure restorable state by default (#151605)
By default, Flutter apps only do default AppKit app serialisation of
Window location etc. and by default, state serialisation in AppKit apps
is compatible with `NSSecureCoding`. AppKit apps generated since Xcode
13.2 include this method in the app delegate generated by the default
app template.

Background
==========

This method was added to opt into having [de]serialization require a
coder implementing the `NSSecureCoding` protocol. Apple wasn't able to
force this across the board, because `NSSecureCoding` limits certain
behaviours during deserialisation, which some third-party apps have have
previously relied on.

Specific background on the sorts of vulnerabilities that
`NSSecureCoding` was designed to prevent are described in the
`NSSecureCoding` documentation:

https://developer.apple.com/documentation/foundation/nssecurecoding?language=objc

A demonstration of a root privilege escalation and SIP bypass
vulnerability is described in the following blog post:
https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/

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

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#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/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-07-12 11:08:26 -07:00
Daco Harkes
cec2400658
[native_assets] Stop running link hooks in JIT mode (#151534)
Stop running link hooks in debug mode.

Rationale: link hooks only get access to tree-shaking info in release builds, so they can't do anything meaningful in debug builds. Debug builds should be fast as development cycle, so running less is better.

More details:

* https://github.com/dart-lang/native/issues/1252

Also: rolls packages to latest versions.

## Implementation details

The decision whether linking is enabled is made as follows:

* For normal builds `build_info.dart::BuildMode` is used to determine whether Dart is compiled in JIT or AOT mode.
* Testers always run in JIT, so no linking.
* Native asset dry runs only run for JIT builds (e.g only when hot reload and hot restart are enabled).

## Testing

The integration test is updated to output an asset for linking if `BuildConfig.linkingEnabled` is true, and to output an asset for bundling directly if linking is not enabled.
2024-07-12 06:44:23 +00:00
flutter-pub-roller-bot
5f7564d989
Roll pub packages (#151492)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-09 22:47:35 +00:00
Daco Harkes
9ab8b6e150
[deps] Roll dart-lang/native packages (#151403)
Pass in the minimum iOS and MacOS version.

Roll dart-lang/native deps.

Related issues:

* https://github.com/flutter/flutter/issues/145104
* Relevant discussion: https://github.com/flutter/flutter/pull/148504
2024-07-09 07:41:35 +00:00
flutter-pub-roller-bot
bf40ae3bc7
Roll pub packages (#151203)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-03 21:47:16 +00:00
Andrew Kolos
271e0427e3
[tool] remove some temporary printTrace calls (#151074)
Cleans up printTrace calls added while investigating https://github.com/flutter/flutter/issues/146879.

Also makes[ this `catch` clause ](https://github.com/flutter/flutter/pull/151074/files#diff-214723283174eb75e740a102252215723aa56716226ea92d084ef8a5bea4e931L578-R581)more precise.
2024-07-02 00:53:19 +00:00
flutter-pub-roller-bot
e8caee1a90
Roll pub packages (#151028)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-07-01 17:43:58 +00:00
flutter-pub-roller-bot
90f2c58d7f
Roll pub packages (#151022)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-29 02:17:17 +00:00
Gray Mackall
f23dbc50f0
Manual engine roll to ddd4814 (#150952)
Manual engine roll up to https://github.com/flutter/engine/pull/53592.

Manual roll because the change requires Gradle lockfiles to be re-generated.
2024-06-27 21:57:32 +00:00
Gray Mackall
0198afa1a4
Reland "Remove dual_screen from new_gallery integration test" (#150873)
Relands https://github.com/flutter/flutter/pull/150808

The original version of the pr [accidentally deleted the back button](https://github.com/flutter/flutter/pull/150808#discussion_r1655444210), which didn't block the app building but made the test hang because it couldn't back out of the demo pages.

Repro-ed the failure, and then tested that 
```
new_gallery_opengles_impeller__transition_perf
new_gallery__transition_perf
new_gallery_impeller_old_zoom__transition_perf
new_gallery__crane_perf
new_gallery_impeller__transition_perf
```

All pass on my pixel 7 pro, with ` dart bin/test_runner.dart test -t <test>`, after re-adding the mistakenly deleted content.

Did not test on an iOS device (I don't have one), but those tests were failing for the same reason from what I can tell:
```
> reply@study
[2024-06-26 12:49:21.884543] [STDOUT] stdout: [        ] scrolling to demo
[2024-06-26 12:49:22.412479] [STDOUT] stdout: [ +527 ms] tapping demo
[2024-06-26 12:49:28.075978] [STDOUT] stderr: [+5663 ms] VMServiceFlutterDriver: tap message is taking a long time to complete...
```
Which is the same error, and which makes sense - they got stuck because they couldn't back out of the page.

Sorry for the churn 🙏
2024-06-26 23:37:55 +00:00
auto-submit[bot]
43a8b6af53
Reverts "Remove dual_screen from new_gallery integration test (#150808)" (#150871)
Reverts: flutter/flutter#150808
Initiated by: gmackall
Reason for reverting: Causing the new_gallery tests to hang.

I can repro now though, so should be able to find a fix shortly
Original PR Author: gmackall

Reviewed By: {christopherfujino, johnmccutchan, jtmcdole, jonahwilliams}

This change reverts the following previous change:
Removes the `dual_screen` package from `new_gallery`. Unblocks the fourth attempt to land https://github.com/flutter/engine/pull/53001.
2024-06-26 19:47:18 +00:00
Gray Mackall
1d1367678a
Remove dual_screen from new_gallery integration test (#150808)
Removes the `dual_screen` package from `new_gallery`. Unblocks the fourth attempt to land https://github.com/flutter/engine/pull/53001.
2024-06-26 19:06:55 +00:00
auto-submit[bot]
778eaf6c1d
Reverts "Manual engine roll to 6884e83 (#150733)" (#150746)
Reverts: flutter/flutter#150733
Initiated by: gmackall
Reason for reverting: This breaks apps that use plugins that use `compileSdk` 31, some of which we use in our postsubmit (so it blocks the tree). 
Original PR Author: gmackall

Reviewed By: {jason-simmons}

This change reverts the following previous change:
Manual engine roll to https://github.com/flutter/engine/pull/53532, because the roll requires lockfile generation.
2024-06-25 01:20:29 +00:00
Gray Mackall
ca116ee535
Manual engine roll to 6884e83 (#150733)
Manual engine roll to https://github.com/flutter/engine/pull/53532, because the roll requires lockfile generation.
2024-06-25 00:52:07 +00:00
Jason Simmons
a27d013850
Manual engine roll to be7db94196fe (#150714)
Includes updates to Gradle lockfiles required by https://github.com/flutter/engine/pull/53280
2024-06-24 20:19:08 +00:00
Gray Mackall
4a84fb0fea
Remove discontinued device_info and connectivity plugins from flutter_gallery, roll pub packages (#150585)
Removes these two discontinued plugins from `dev/integration_tests/flutter_gallery`

[`device_info`](https://pub.dev/packages/device_info):
Apparently the video playback doesn't work on iOS simulators (I wasn't able to verify this, as I don't have an iOS simulator installed). I removed the guard against running on those simulators, and replaced with a note in the README.

[`connectivity`](https://pub.dev/packages/connectivity):
This plugin was used to play the bee video from the network. I changed the demo so that the bee video is instead also played from an asset (like its friend the butterfly), and then removed the use of the plugin.

Unblocks the re-land of https://github.com/flutter/engine/pull/53462 (itself a reland 🙂), because of https://github.com/flutter/flutter/pull/150465#issuecomment-2181403712.
2024-06-21 23:10:24 +00:00
Kate Lovett
62586dc09d
Update old wiki links (#149544)
Part of https://github.com/flutter/flutter/issues/145009

Finishes updating links in the repo that pointed to the old wiki
2024-06-17 17:26:08 +00:00
John McDole
e80bbd929e
Fix flaky complex_layout_scroll_perf__memory & flutter_gallery__memory_nav (#150368)
Initial tap is missing sometimes; either its never delivered or it is
delivered before gesture controller is hooked up.

1: Update MemoryTest to have option `requiresTapToStart` guarding the
   new paths
2: Update the two perf tests that appear to be flaky to output when
   TAPPED is received
3: Update the MemoryTest to keep tapping while waiting for TAPPED

Tested on devicelab:
* setting iterations=1
* removing the timeout before READY
* running tests in a while loop

Before this change, you could get the test to hang often. After this
change you'll see "tapping device... [x]" where x is the counter.

Fixes https://github.com/flutter/flutter/issues/150096
2024-06-17 17:14:47 +00:00
auto-submit[bot]
9fe71d99b9
Reverts "Fix flaky complex_layout_scroll_perf__memory test (#150287)" (#150293)
Reverts: flutter/flutter#150287
Initiated by: jtmcdole
Reason for reverting: other memperf tests don't wait for or send a TAPPED; so they fail.
Original PR Author: jtmcdole

Reviewed By: {gaaclarke}

This change reverts the following previous change:
Initial tap is missing sometimes; either its never delivered or it is delivered before gesture controller is hooked up.

1: Update the two perf tests to output when TAPPED is received
2: Update the MemoryTest to keep tapping while waiting for TAPPED

Tested on devicelab:
* setting iterations=1
* removing the timeout before READY
* running tests in a while loop

Before this change, you could get the test to hang often. After this change you'll see "tapping device... [x]" where x is the counter.

Fixes #150096
2024-06-15 03:27:28 +00:00
John McDole
499c84cbf8
Fix flaky complex_layout_scroll_perf__memory test (#150287)
Initial tap is missing sometimes; either its never delivered or it is delivered before gesture controller is hooked up.

1: Update the two perf tests to output when TAPPED is received
2: Update the MemoryTest to keep tapping while waiting for TAPPED

Tested on devicelab:
* setting iterations=1
* removing the timeout before READY
* running tests in a while loop

Before this change, you could get the test to hang often. After this change you'll see "tapping device... [x]" where x is the counter.

Fixes #150096
2024-06-15 00:55:05 +00:00
flutter-pub-roller-bot
e110fdd1c9
Roll pub packages (#150267)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-14 18:19:41 +00:00
Greg Spencer
d68e05bf36
Reland: Request focus if accessibility focus is given to a Focus widget (#142942) (#149840)
## Description

This attempts to re-land #142942 after being reverted in https://github.com/flutter/flutter/pull/149741 because it broke the iOS [platform view UI integration test](https://github.com/flutter/flutter/blob/master/dev/integration_tests/ios_platform_view_tests/ios/PlatformViewUITests/PlatformViewUITests.m?rgh-link-date=2024-06-06T19%3A47%3A27Z).

The changes here from the original are that in the Focus widget we no longer set the `onFocus` for the `Semantics` if the platform is iOS.  It was not intended to do anything on iOS anyhow.

Also, I updated the matchers to not actually do anything yet with the SemanticsAction.focus matching, so that this can be landed without breaking customer tests, and once they have been updated to correctly look for the focus action, we can land a PR that will turn it on.

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

## Tests
 - Updated framework tests to look for the appropriate things using the matchers, even though it doesn't actually test for them yet.
2024-06-12 20:05:10 +00:00
flutter-pub-roller-bot
ad462e2783
Roll pub packages (#150070)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-12 05:40:31 +00:00
Michael Goderbauer
1b8d083ab6
Manual Pub Roll (#150025)
Supersedes https://github.com/flutter/flutter/pull/149908
2024-06-11 00:02:26 +00:00
Gray Mackall
b889e3a6f7
Unpin camera_android and remove its only usage (#150017)
Fixes https://github.com/flutter/flutter/issues/146004

The `camera_android`plugin had its version pinned when it was still used in the `gradle_deprecated_settings`. It has since been [replaced](https://github.com/flutter/flutter/pull/148426) by `camera_android_camerax`, and therefore isn't used in `flutter/flutter`. So it's pin should be fine to remove.
2024-06-10 22:13:00 +00:00
Jason Simmons
4e6e61dfd5
Retain the toString method for subclasses of Key in profile/release mode (#149926)
toString methods are removed in AOT builds by the optimization in https://github.com/flutter/flutter/pull/144763

This PR disables that for Key subclasses because some applications rely on the previous behavior.

Fixes https://github.com/flutter/flutter/issues/148983
2024-06-10 16:06:02 +00:00
flutter-pub-roller-bot
9a654cb5da
Roll pub packages (#149864)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-07 00:22:25 +00:00
flutter-pub-roller-bot
27972ebb48
Roll pub packages (#149852)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-06 22:35:15 +00:00
flutter-pub-roller-bot
50998a99f2
Roll pub packages (#149630)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-06 18:08:49 +00:00
Matan Lurey
d1e17c338b
Remove unused code from an older test artifact. (#149746)
This does nothing. Let's send it to the void!
2024-06-05 21:07:08 +00:00
auto-submit[bot]
ec9965bd89
Reverts "Request focus if SemanticsAction.focus is sent to a focusable widget (#142942)" (#149741)
Reverts: flutter/flutter#142942
Initiated by: zanderso
Reason for reverting: Seems to have affected iOS platform view focus: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20native_platform_view_ui_tests_ios/10626/overview
Original PR Author: gspencergoog

Reviewed By: {yjbanov, goderbauer, chunhtai}

This change reverts the following previous change:
## Description

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

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

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

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

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

## Tests
 - Added a test to make sure that focus is requested when `SemanticsAction.focus` is sent by the engine.
2024-06-05 00:42:59 +00:00
flutter-pub-roller-bot
99cf2b6e5a
Roll pub packages (#149617)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-06-03 22:15:41 +00:00
engine-flutter-autoroll
86321ed229
Manual roll Flutter Engine from e19d7cde4686 to fa3065875564 (2 revisions) (#149436)
Manual roll requested by jacksongardner@google.com

e19d7cde46...fa30658755

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

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-05-31 20:59:53 +00:00
Gray Mackall
d89ae48520
Manual pub roll w/ gradle lockfile regeneration (#149342)
Manual recreation of https://github.com/flutter/flutter/pull/148911

Entire PR is just the output of 
```
flutter update-packages --force-upgrade
```
followed by (run from the root of the flutter repo)
```
find . -type d -name 'android' | dart dev/tools/bin/generate_gradle_lockfiles.dart --no-gradle-generation --no-exclusion
```
2024-05-30 23:04:08 +00:00
engine-flutter-autoroll
697d99fae8
Manual roll Flutter Engine from 60968ee3bde7 to 8d5d14a1db95 (1 revision) (#149263)
Manual roll requested by jacksongardner@google.com

60968ee3bd...8d5d14a1db

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

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-05-30 00:53:23 +00:00
Daco Harkes
1f16d9121c
[native_assets] Add support for link hooks (#148474)
This PR adds support invoking `link.dart` hooks.

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

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

Issue:

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

## Implementation considerations

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

## Testing

* The unit tests verify that the native_assets_builder `link` and `linkDryRun` would be invoked with help of the existing fake.
* The native assets integration test now also invokes an FFI call of a package that adds the asset during the link hook instead of the build hook.
  * In order to keep coverage of the `flutter create --template=package_ffi`, `flutter create` is still run and the extra dependency is added and an extra ffi call is added. (Open to alternative suggestions.)
2024-05-22 16:02:00 +00:00
Jackson Gardner
31fc593724
Fix the output of the CDN test. (#148730)
This test was outputting the "success" string multiple times, which is probably causing the harness to kill the app halfway through its cycle. I suspect this is causing some of the flakiness we've seen of this test. Instead, we should just output the string at the very end of the test, right before the app is done.
2024-05-21 18:07:23 +00:00
Nate
870c5541c3
switch expressions: finale (#148711)
### fixes #136139

<br>

<details open> <summary><b>getting sentimental in the PR description</b> (click to collapse)<br><br></summary>

The past 7 months have been quite the journey—I made some huge blunders and some huge accomplishments—a very fun time overall.

I really appreciate the people who took the time to perform code review for my refactoring shenanigans: **christopherfujino**, **andrewkolos**, **LongCatIsLooong**, **gspencergoog**, **loic-sharma**, **Piinks**, **bernaferrari**, **bartekpacia**, **bleroux**, **kevmoo**, **rakudrama**, **XilaiZhang**, **QuncCccccc**, **MominRaza**, and **victorsanni**.

And a huge shoutout to 2 individuals:
- @justinmc, for offering to sponsor me for commit access (words could not describe my excitement)
- @goderbauer, for being super duper proactive and consistent with code review

<br>

</details>

This pull request makes 13 "switch statements → switch expressions" PRs in total, reducing the LOC in this repo by **1,974**!

From now on, I'll make sure to request a test exemption for each refactoring PR 🙂
2024-05-21 16:18:05 +00:00
Michael Goderbauer
40b5bc3117
Manual roll camera dependency (#148426)
Supersedes https://github.com/flutter/flutter/pull/148245
2024-05-20 23:40:38 +00:00
Nate
76a07a1646
Implement new AnimationStatus getters (#148570)
PR #147801 introduced some convenient `AnimationStatus` getters, but I just realized that `AnimationController` now has 2 getters for the same thing: `isAnimating` and `isRunning`.

The intent of this pull request is to correct that mistake, and implement the getters in the appropriate places.
2024-05-20 17:43:03 +00:00
Nate
73ecc8a9b2
Reland "if chains → switch expressions" (#148634)
I did a goof a while back:

![late initialization error](https://github.com/flutter/flutter/assets/10457200/47dc423f-0dd0-4869-9a11-59cb7d1ea46e)

Now that [the bug is fixed](e9d403541f), I think we're good to re-implement the if-chains cleanup!

Related:

- https://github.com/flutter/flutter/pull/147793
- https://github.com/flutter/flutter/pull/148556
- https://github.com/flutter/flutter/issues/148548
2024-05-20 17:43:00 +00:00
Zachary Anderson
597462a3c4
Revert "if chains → switch expressions" (#148556)
Reverts flutter/flutter#147793

Introduced https://github.com/flutter/flutter/issues/148548.
2024-05-17 10:27:02 -07:00
Nate
fa9992eff6
switch statement cleanup (#148382)
This PR is step 12 in the journey to solve issue #136139 and make the
entire Flutter repo more readable.

Most of it involves implementing switch expressions, and there's also a
few other random things that I wanted to clean up a bit.
2024-05-16 17:16:06 -07:00
flutter-pub-roller-bot
3c26c56ffa
Roll pub packages (#148148)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-05-10 22:24:27 +00:00
Nate
4734d80f22
if chains → switch expressions (#147793)
Previous "if-chains" pull requests:
- https://github.com/flutter/flutter/pull/144905
- https://github.com/flutter/flutter/pull/144977
- https://github.com/flutter/flutter/pull/145194
- https://github.com/flutter/flutter/pull/146293
- https://github.com/flutter/flutter/pull/147472

<br>

I think this one should be enough to wrap things up!

fixes https://github.com/flutter/flutter/issues/144903

---------

Co-authored-by: Victor Sanni <victorsanniay@gmail.com>
2024-05-10 00:55:48 -06:00
Christopher Fujino
730d6d44b7
Don't pin package:macros (#148087)
Full context https://github.com/flutter/flutter/issues/148004

TL;DR

1. Because `package:macros` depends on `package:_macros` via [a Dart SDK
dependency](https://github.com/dart-lang/sdk/blob/main/pkg/macros/pubspec.yaml#L13);
and
2. `package:macros` exactly pins `package:_macros`; and
3. Each new version of `package:macros` will increment its exact pin of
`package:_macros`
([comment](https://github.com/flutter/flutter/issues/148004#issuecomment-2103099893));
and
4. The [flutter/flutter](https://github.com/flutter/flutter) repository
exactly pins the Dart SDK (via its exact pin on the
[flutter/engine](https://github.com/flutter/engine) repository

Therefore, the [flutter/flutter](https://github.com/flutter/flutter)
repository effectively pins both `package:macros` and `package:_macros`
already (as in, there exists only a single version of each that pub will
successfully be able to solve within the context of a particular Flutter
SDK).

Therefore, it is safe for
[flutter/flutter](https://github.com/flutter/flutter) repository to
*not* pin `package:macros`, which will allow engine -> framework rolls
that contain a new Dart SDK that contains a new `package:_macros`
version to land automatically, provided all tests pass.
2024-05-09 16:28:49 -07:00
flutter-pub-roller-bot
076e701f46
Roll pub packages (#148011)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-05-09 04:45:28 +00:00
flutter-pub-roller-bot
b7a9e60850
Roll pub packages (#147995)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-05-08 20:28:00 +00:00
Sam Rawlins
39d8492fb8
Tweak to fix context.mounted in dialog_demo (#147998)
Prepares for a fix to the `use_build_context_synchronously` lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages.

The lint rule cannot tell that the `mounted` field is shorthand for `context.mounted`.
2024-05-08 19:56:22 +00:00
Danny Tuppeny
cea1d6f055
Unpin DDS and roll pub packages (#147925)
DDS was temporarily pinned to 4.1.0 because 4.2.0 triggered some test
failures (see https://github.com/flutter/flutter/pull/147250). Those
failures should be fixed by vm_service 14.2.2, so this unpins DDS and
rolls both of these packages (along with devtools_shared, which is a DDS
dependency).

(If the bot updates vm_service before this is done, I can rebase over
that will reduce the size of this PR to just a few files)
2024-05-08 10:35:28 +01:00
Michael Goderbauer
8796562d0a
Properly guard context access in then clauses (#147935)
Prepares for a fix to the `use_build_context_synchronously` lint (https://dart-review.googlesource.com/c/sdk/+/365541) that will complain about these unsafe usages.
2024-05-07 20:50:46 +00:00
Gray Mackall
d04edd1d7f
Add kotlinOptions jvmTarget to templates (#147326)
Adds jvmTarget to gradle templates. 

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

Interestingly, we already had this in many of our examples/tests, see search results here https://github.com/search?q=repo%3Aflutter%2Fflutter%20jvmTarget&type=code.
2024-05-07 17:32:10 +00:00
chunhtai
007faa980d
Reapply new PopScope API (#147607)
same as previous but with soft transition on modalroute

## 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-05-07 09:04:49 -07:00
flutter-pub-roller-bot
c0ed9f6ff4
Roll pub packages (#147896)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-05-06 23:36:21 +00:00
flutter-pub-roller-bot
d4b2e5d705
Roll pub packages (#147891)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-05-06 22:39:58 +00:00
Jonah Williams
5230ec5ba4
[new gallery] Reisze gallery images (#147882)
Some cause of jank on both Skia and Impeller are these massive images. We should just resize them so that the noise is reduced and we can see other performance issues.

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

Tested: this is a test!
2024-05-06 19:20:32 +00:00
Greg Spencer
2e78ed0ff9
Allow explicit exclusion of packages from pinned packages in flutter update-packages --force-update (#147679)
## Description

This introduces a list of packages that we will explicitly not pin.  It is to be used for things where the package isn't actually published, but is a transitive dependency of another package included in the SDK.  This happens with the `macros` package, for instance, which depends on the private, unpublished, `_macros` package where the SDK does some tricky things to depend on it (it depends on "any", but ships it as part of the SDK).

Also ran `flutter update-packages --force-update` to update all of the pubspec files.

## Related Issues
 - Fixes #147656

## Tests
 - Added a test that makes sure that explicitly unpinned packages don't show up in the pinned list.
2024-05-02 01:16:54 +00:00
Yegor
f256f68831
[web] remove platform_messages_integration test (#147654)
This functionality is already fully covered by https://github.com/flutter/engine/blob/main/lib/web_ui/test/engine/platform_views/message_handler_test.dart

This might help with https://github.com/flutter/flutter/issues/146189 a little.
2024-05-01 21:12:01 +00:00
Kishan Dhankecha
2867ac7885
Added missing code block language in docs (#147481)
- added language for all code blocks
- replaced `bash` or `shell` with `sh` for consistency.
- added `sh` and `console` in the GitHub template link generator.
- updated test for GitHub template.
2024-05-01 14:44:27 +00:00
chunhtai
3e399c1578
Revert "add a new PopScope.onPopWithResultInvoke widget to replace Po… (#147597)
…pScope.onPopInvoke (#147016)"

This reverts commit 8031a3e30c.

Needs to migrate flutter_eval

## 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-04-30 13:25:24 -07:00
Elliott Brooks
c1c7898b96
Bump dependencies in Flutter (#147546) 2024-04-29 15:53:25 -07:00
chunhtai
8031a3e30c
add a new PopScope.onPopWithResultInvoke widget to replace PopScope.onPopInvoke (#147016)
same as https://github.com/flutter/flutter/pull/139164, but make it a soft transition
2024-04-26 04:06:11 +00:00
flutter-pub-roller-bot
b4121a1867
Roll pub packages (#147094)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-22 20:42:07 +00:00
Anis Alibegić
140edb9883
Fixed few typos (#147087)
Here's another PR with a couple of typos fixed. As you can see there was a typo in _fileReferenceI**n**dentifiers_, in class _ParsedProjectInfo._ Maybe we should do some check on that since I'm not sure if that property is used somewhere outside Flutter?
2024-04-22 16:49:19 +00:00
flutter-pub-roller-bot
16a2fe88d3
Roll pub packages (#147030)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-19 23:15:37 +00:00
auto-submit[bot]
bb4c9b381e
Reverts "Add generic type for result in PopScope (#139164)" (#147015)
Reverts: flutter/flutter#139164
Initiated by: chunhtai
Reason for reverting: hard breaking change
Original PR Author: chunhtai

Reviewed By: {justinmc}

This change reverts the following previous change:
Adds a generic type and pop result to popscope and its friend.

The use cases are to be able to capture the result when the pop is called.

migration guide: https://github.com/flutter/website/pull/9872
2024-04-18 22:36:26 +00:00
chunhtai
7ee05a05ff
Add generic type for result in PopScope (#139164)
Adds a generic type and pop result to popscope and its friend.

The use cases are to be able to capture the result when the pop is called.

migration guide: https://github.com/flutter/website/pull/9872
2024-04-18 19:30:10 +00:00
Loïc Sharma
86135b7774
[macOS] Migrate @NSApplicationMain attribute to @main (#146848)
This migrates Flutter to use the `@main` attribute introduced in Swift 5.3. The `@NSApplicationMain` attribute is deprecated and will be removed in Swift 6. See: https://github.com/apple/swift-evolution/blob/main/proposals/0383-deprecate-uiapplicationmain-and-nsapplicationmain.md

This change is split into two commits:

1. a508d3e503 - This updates the macOS app template and adds a migration to replace `@NSApplicationMain` uses with `@main`. 
2. f43482786e - I ran `flutter run -d macos` on each Flutter macOS app in this repository to verify the app migrates and launches successfully.

Follow-up to https://github.com/flutter/flutter/pull/146707
Fixes https://github.com/flutter/flutter/issues/143044
2024-04-18 03:08:36 +00:00
Michael Goderbauer
63f917c36d
Bump meta to 1.14.0 (#146925)
Not sure why the auto-roller hasn't picked this up...
2024-04-17 15:25:51 -07:00
Derek Xu
cf26b1150f
Unpin frontend_server_client and roll packages (#146650) 2024-04-17 12:43:20 -04:00
Pierre-Louis
4a65a76279
Reland: Update link branches to main (#146882)
Reland https://github.com/flutter/flutter/pull/146558, reverted in https://github.com/flutter/flutter/pull/146880 due to an outdated test result

## Original description

- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for specified repos.

Part of https://github.com/flutter/flutter/issues/121564
2024-04-17 13:16:33 +00:00
Pierre-Louis
33a9643b5d
Revert "Update link branches to main" (#146880)
Reverts flutter/flutter#146558

Causes failure
2024-04-17 13:25:18 +02:00
Pierre-Louis
072b8874a0
Update link branches to main (#146558)
- Update CS and googlesource.com link branches
- Update GitHub /blob/ and /tree/ links

Tested links manually and fixes a few broken or deprecated links

Added a test that validates that `master` isn't used, except for
specified repos.

Part of https://github.com/flutter/flutter/issues/121564

## 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-04-17 09:44:23 +02:00
flutter-pub-roller-bot
3d51fa9b9c
Roll pub packages (#146851)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-16 23:50:16 +00:00
Loïc Sharma
194fefaa53
[iOS] Migrate @UIApplicationMain attribute to @main (#146707)
This migrates Flutter to use the `@main` attribute introduced in Swift 5.3. The `@UIApplicationMain` attribute is deprecated and will be removed in Swift 6. See: https://github.com/apple/swift-evolution/blob/main/proposals/0383-deprecate-uiapplicationmain-and-nsapplicationmain.md

This change is split into two commits:

1. ad18797428 - This updates the iOS app template and adds a migration to replace `@UIApplicationMain` uses with `@main`. 
2. 8ecbb2f29f - I ran `flutter run` on each Flutter iOS app in this repository to verify the app migrates and launches successfully.

Part of https://github.com/flutter/flutter/issues/143044
2024-04-16 22:13:03 +00:00
flutter-pub-roller-bot
4efdf190a8
Roll pub packages (#146842)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-16 22:07:27 +00:00
flutter-pub-roller-bot
c06faf49e1
Roll pub packages (#146797)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-16 06:44:25 +00:00
flutter-pub-roller-bot
e6a06913a3
Roll pub packages (#146782)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-15 22:16:05 +00:00
Nate
2e748e8598
Implementing control flow collections (#146601)
This pull request aims for improved readability, based on issue #146600.

```dart
// before
Set<Color> _distinctVisibleColors() {
  final Set<Color> distinctVisibleColors = <Color>{};
  if (top.style != BorderStyle.none) {
    distinctVisibleColors.add(top.color);
  }
  if (right.style != BorderStyle.none) {
    distinctVisibleColors.add(right.color);
  }
  if (bottom.style != BorderStyle.none) {
    distinctVisibleColors.add(bottom.color);
  }
  if (left.style != BorderStyle.none) {
    distinctVisibleColors.add(left.color);
  }
  return distinctVisibleColors;
}

// after
Set<Color> _distinctVisibleColors() {
  return <Color>{
    if (top.style != BorderStyle.none) top.color,
    if (right.style != BorderStyle.none) right.color,
    if (bottom.style != BorderStyle.none) bottom.color,
    if (left.style != BorderStyle.none) left.color,
  };
}
```

Most of the repo should be covered in this PR (aside from `flutter_tools/`, since there was a lot going on in there).
2024-04-15 16:06:07 +00:00
flutter-pub-roller-bot
aac767e66a
Roll pub packages (#146704)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-12 22:34:37 +00:00
Christopher Fujino
7a30d2b4ca
[flutter_tools] Fix conductor for package args roll (#146646)
The interface for `ArgResults` from `package:args` has added new fields. Change the implementations of these in the conductor to extend `Fake` so that these aren't analyzer errors.

This broke the pub roll here: https://github.com/flutter/flutter/pull/146642#issuecomment-2050169629
2024-04-12 21:38:03 +00:00
Jackson Gardner
9973673752
Support flutter run --wasm and flutter drive --wasm. (#146231)
This adds support for adding the `--wasm` flag to `flutter run` and `flutter drive`
* Emits errors if you attempt to use the skwasm renderer without the `--wasm` flag
* Emits errors if you try to use `--wasm` when not using a web device
* Uses the skwasm renderer by default if you pass `--wasm` and no `--web-renderer`
2024-04-12 19:27:26 +00:00
Chris Bracken
a34086a573
[Windows] Drop support for Windows 7/8 apps in template (#146668)
Since Flutter no longer supports Windows 7.x or 8.x, this eliminates support from the Windows app template. No tests to eliminate, since Windows 7 and 8 were "best-efforts" tier and untested.

Fixes: https://github.com/flutter/flutter/issues/140830
RFC: http://flutter.dev/go/flutter-drop-win7-2024
2024-04-12 01:07:20 +00:00
flutter-pub-roller-bot
6f9fff1f7c
Roll pub packages (#146515)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-09 17:23:16 +00:00
flutter-pub-roller-bot
84c7298ba1
Roll pub packages (#146444)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-08 18:48:19 +00:00
Gray Mackall
22e0c89f0a
Reland "Bump to AGP 8.1/Gradle 8.3 (almost) everywhere" (#146307)
Relands https://github.com/flutter/flutter/pull/146181.

Just 3 commits:
1. a revert of the revert
2. the fix described in https://github.com/flutter/flutter/pull/146181#issuecomment-2038238869
3. updating two postsubmit tests from Java 11 to 17, as that is required for this new AGP version.

I've verified that `flutter build apk --flavor paid --debug` fails in `dev/integration_tests/flavors/` with the error in ci without (2), and succeeds with it. 

I've also verified that the `dev/benchmarks/complex_layout` app builds successfully with Java 17.

That covers all the postsubmits that failed according [to the dashboard](https://flutter-dashboard.appspot.com/#/build).
2024-04-05 19:09:20 +00:00
flutter-pub-roller-bot
b0f52b5be2
Roll pub packages (#146348)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-05 17:30:07 +00:00
flutter-pub-roller-bot
45deb49716
Roll pub packages (#146331)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-04-05 10:42:30 +00:00
auto-submit[bot]
23ecc37ed2
Reverts "Bump to AGP 8.1/Gradle 8.3 (almost) everywhere (#146181)" (#146305)
Reverts: flutter/flutter#146181
Initiated by: LongCatIsLooong
Reason for reverting: https://ci.chromium.org/ui/p/flutter/builders/prod/Windows_android%20flavors_test_win/11086/overview
Original PR Author: gmackall

Reviewed By: {reidbaker, christopherfujino}

This change reverts the following previous change:
Bump almost all tests to AGP 8.1 and Gradle 8.3

Flutter gallery is excluded, because it uses discontinued plugins that in turn use old Gradle versions, and that prevents upgrading. Will take some extra work to figure out what to do there.

Should bump templates next

Entire PR generated with the lockfile generation script, except for:
1. changes within `dev/integration_tests/gradle_deprecated_settings/android/`, which must be done manually (and exclusion of the gallery for reason mentioned above).
2. Changes to many `AndroidManifest.xml` files to remove the `package` attribute and instead set that same value in the `build.gradle`, in the `namespace` attribute of the `android` closure (corresponds to an AGP behavior change, see  https://d.android.com/r/tools/upgrade-assistant/set-namespace).
3. Removes the use of the `battery` plugin in `android_embedding_v2_smoke_test` because the plugin is discontinued, unused, and blocks upgrading the AGP version for that app because the discontinued plugin itself uses a very old AGP version.
2024-04-04 21:07:17 +00:00
Gray Mackall
ab520c9849
Bump to AGP 8.1/Gradle 8.3 (almost) everywhere (#146181)
Bump almost all tests to AGP 8.1 and Gradle 8.3

Flutter gallery is excluded, because it uses discontinued plugins that in turn use old Gradle versions, and that prevents upgrading. Will take some extra work to figure out what to do there.

Should bump templates next

Entire PR generated with the lockfile generation script, except for:
1. changes within `dev/integration_tests/gradle_deprecated_settings/android/`, which must be done manually (and exclusion of the gallery for reason mentioned above).
2. Changes to many `AndroidManifest.xml` files to remove the `package` attribute and instead set that same value in the `build.gradle`, in the `namespace` attribute of the `android` closure (corresponds to an AGP behavior change, see  https://d.android.com/r/tools/upgrade-assistant/set-namespace).
3. Removes the use of the `battery` plugin in `android_embedding_v2_smoke_test` because the plugin is discontinued, unused, and blocks upgrading the AGP version for that app because the discontinued plugin itself uses a very old AGP version.
2024-04-04 20:11:09 +00:00
Gray Mackall
29ed214e7f
Set up Kotlin linting step in ci with ktlint (#143478)
Adds a kotlin linting step to the linux analyze check, using a version of [ktlint](https://github.com/pinterest/ktlint) hosted on [CIPD](https://chrome-infra-packages.appspot.com/p/flutter/ktlint/linux-amd64/+/version_1_1_1).

Configured to disallow trailing commas, because of (and now acting as a test for) https://github.com/flutter/flutter/pull/145718. Because of this configuration the PR also removes some trailing commas in some kotlin files.

Also checks in a baseline file.
2024-04-03 21:21:00 +00:00
Qun Cheng
69db714fbb
Update material_color_utilities package version to latest 0.11.1 (#145959)
This PR is to update material_color_utilities package version to the latest. `material_color_utilities/scheme/scheme_fruit_salad.dart` and `material_color_utilities/scheme/scheme_rainbow.dart` are exported after version 0.9.0.

Once this PR is merged, we don't need to explicitly import these two files like the change in PR #144805, which breaks some dependencies in `Google testing`.
2024-04-03 02:16:13 +00:00
Polina Cherkasova
bca1d6ad1f
Upgrade leak_tracker. (#145997) 2024-03-29 12:31:52 -07:00
Polina Cherkasova
1a2f34ab5b
Upgrade leak_tracker. (#145940) 2024-03-29 02:39:17 +00:00
David Iglesias
9786682492
[web] Add BackgroundIsolateBinaryMessenger.ensureInitialized to web. (#145786)
This PR makes the static API of the `BackgroundIsolateBinaryMessenger` consistent between its web and IO implementations.

This way, multi-platform applications will compile for the web when using the `ensureInitialized` method (even though it'll throw at runtime, like the `instance` getter, because isolates are not supported on the web).

### Issues

* Fixes: https://github.com/flutter/flutter/issues/145260
2024-03-26 23:51:23 +00:00
Christopher Fujino
385bec0abb
Roll pub packages and regenerate gradle lockfiles (#145727)
Example failing devicelab build https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_pixel_7pro%20platform_views_scroll_perf__timeline_summary/2980/overview

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

Supercedes https://github.com/flutter/flutter/pull/145564
2024-03-26 22:07:06 +00:00
Michael Goderbauer
eaf509aaf8
Eliminate more window singleton usages (#145560)
These usages in strings slipped through the initial clean-up.
2024-03-21 20:59:25 +00:00
Jackson Gardner
31209d04ff
flutter test --wasm support (#145347)
* Adds support for `flutter test --wasm`.
  * The test compilation flow is a bit different now, so that it supports compilers other than DDC. Specifically, when we run a set of unit tests, we generate a "switchboard" main function that imports each unit test and runs the main function for a specific one based off of a value set by the JS bootstrapping code. This way, there is one compile step and the same compile output is invoked for each unit test file.
* Also, removes all references to `dart:html` from flutter/flutter.
* Adds CI steps for running the framework unit tests with dart2wasm+skwasm
  * These steps are marked as `bringup: true`, so we don't know what kind of failures they will result in. Any failures they have will not block the tree at all yet while we're still in `bringup: true`. Once this PR is merged, I plan on looking at any failures and either fixing them or disabling them so we can get these CI steps running on presubmit.

This fixes https://github.com/flutter/flutter/issues/126692
2024-03-21 20:08:07 +00:00
auto-submit[bot]
fd18e5ce48
Reverts "Roll pub packages (#145509)" (#145550)
Reverts: flutter/flutter#145509
Initiated by: yusuf-goog
Reason for reverting: Failing builds, blocking tree.
Original PR Author: flutter-pub-roller-bot

Reviewed By: {fluttergithubbot}

This change reverts the following previous change:
This PR was generated by `flutter update-packages --force-upgrade`.
2024-03-21 17:32:48 +00:00
flutter-pub-roller-bot
5545c95df7
Roll pub packages (#145509)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-03-21 16:16:07 +00:00
flutter-pub-roller-bot
61b3f975a0
Roll pub packages (#145476)
This PR was generated by `flutter update-packages --force-upgrade`.
2024-03-21 00:09:24 +00:00
goodmost
3236957f02
chore: fix some comments (#145397)
fix some comments
2024-03-19 17:00:24 +00:00
Loïc Sharma
8d54abfc22
Roll pub packages manually (#145170)
The automated roll failed as a test needs to be updated: https://github.com/flutter/flutter/pull/145167

Fixes: https://github.com/flutter/flutter/issues/139861
2024-03-15 14:12:22 +00:00
Nate
b9e537336f
Turning if chains into shorter switch statements (#144977)
This pull request is part of the effort to solve issue #144903.

In the past, my efforts to reduce line length involved refactoring away from switch statements, but unlike [yesterday's PR](https://github.com/flutter/flutter/pull/144905), this one is full of switch statements that make things more concise!
2024-03-13 17:16:17 +00:00
Jackson Gardner
3c30e3cb20
Flutter Web Bootstrapping Improvements (#144434)
This makes several changes to flutter web app bootstrapping.
* The build now produces a `flutter_bootstrap.js` file.
  * By default, this file does the basic streamlined startup of a flutter app with the service worker settings and no user configuration.
  * The user can also put a `flutter_bootstrap.js` file in the `web` subdirectory in the project directory which can have whatever custom bootstrapping logic they'd like to write instead. This file is also templated, and can use any of the tokens  that can be used with the `index.html` (with the exception of `{{flutter_bootstrap_js}}`, see below).
* Introduced a few new templating tokens for `index.html`:
  * `{{flutter_js}}` => inlines the entirety of `flutter.js`
  * `{{flutter_service_worker_version}}` => replaced directly by the service worker version. This can be used instead of the script that sets the `serviceWorkerVersion` local variable that we used to have by default.
  * `{{flutter_bootstrap_js}}` => inlines the entirety of `flutter_bootstrap.js` (this token obviously doesn't apply to `flutter_bootstrap.js` itself).
* Changed `IndexHtml` to be called `WebTemplate` instead, since it is used for more than just the index.html now.
* We now emit warnings at build time for certain deprecated flows:
  * Warn on the old service worker version pattern (i.e.`(const|var) serviceWorkerVersion = null`) and recommends using `{{flutter_service_worker_version}}` token instead
  * Warn on use of `FlutterLoader.loadEntrypoint` and recommend using `FlutterLoader.load` instead
  * Warn on manual loading of `flutter_service_worker.js`.
* The default `index.html` on `flutter create` now uses an async script tag with `flutter_bootstrap.js`.
2024-03-12 22:41:26 +00:00
Gray Mackall
d5896d5ede
Manually roll pub packages (#145005)
Manual takeover of https://github.com/flutter/flutter/pull/145003, to include some gradle lockfile changes.
2024-03-12 19:53:57 +00: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
Polina Cherkasova
a04fe3169a
Upgrade vm_service. (#144845) 2024-03-08 17:09:07 -08: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
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
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
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
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
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
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
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
Victoria Ashworth
00229827ab
Retry button tap in [FlutterUITests testFlutterViewWarm] (#143967)
Attempting to fix https://github.com/flutter/flutter/issues/142125.
2024-02-23 16:13:21 +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
Gray Mackall
3ae71f5c43
Delete local.properties that shouldn't have been pushed (#143774)
This file shouldn't be in version control

## 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].
- [ ] 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

Co-authored-by: Gray Mackall <mackall@google.com>
2024-02-20 11:55:51 -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
Jonah Williams
a22c2305b3
[devicelab] retain prior events for flutter gallery. (#143554)
Capture first frames in gallery benchmarks

Calling https://github.com/flutter/flutter/issues/143404 fixed, since all the full app benchmarks capture the start now.

Fixes https://github.com/flutter/flutter/issues/143404
2024-02-16 01:13:01 +00:00
Jonah Williams
2d4f5a65c4
[devicelab] introduce new old gallery. (#143486)
Fixes https://github.com/flutter/flutter/issues/143482

This brings in the gallery more or less as is:

* Removed localizations
* Ensure tests still run (locally verified, will switch CI later).
* Removed deferred components
* Fixup pubspec
2024-02-15 20:01:14 +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
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
Jonah Williams
295eeaf100
[devicelab] retain first frame data in certain integration tests. (#143419)
Part of https://github.com/flutter/flutter/issues/143404

We currently drop the first N frames of all benchmarks. For the app based benchmarks (not microbenchmarks) this is harmful as we miss first time initialization costs in our CI.

Still need to do this with flutter/gallery, but that lives in a different repo.
2024-02-14 03:58:58 +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
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
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
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
engine-flutter-autoroll
d385d027f1
Roll Flutter Engine from 8c521eb24171 to 6a3b0216ff5b (4 revisions) (#143251)
8c521eb241...6a3b0216ff

2024-02-09 30870216+gaaclarke@users.noreply.github.com [Impeller] cleaned up StrokePathGeometry and removed runtime polymorphism (flutter/engine#50506)
2024-02-09 ditman@gmail.com [web] Fix HtmlViewEmbedder.dispose (flutter/engine#50482)
2024-02-09 skia-flutter-autoroll@skia.org Roll Dart SDK from 03130d49f214 to 444f7a422da4 (6 revisions) (flutter/engine#50502)
2024-02-09 jonahwilliams@google.com [Impeller] improve performance of polyline and stroke generation by reducing allocation and lambda usage. (flutter/engine#50379)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC chinmaygarde@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
2024-02-09 23:20:57 +00:00
Polina Cherkasova
b48dfca382
Upgrade leak_tracker. (#143236) 2024-02-09 14:41:22 -08: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
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
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
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]
f8a77225f3
Reverts "Update gradle lockfiles template" (#142889)
Reverts flutter/flutter#140115

Initiated by: bartekpacia

Reason for reverting: broke the tree

- [`Linux firebase_abstract_method_smoke_test`](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20firebase_abstract_method_smoke_test/15844/overview)
- [`Linux_android android_view_scroll_perf__timeline_summary`](https://ci.chromium.org/ui/p/flutter/builders/prod/Linux_android%20android_view_scroll_perf__timeline_summary/13453/overview)
- [`Linux_android platform_views

Original PR Author: bartekpacia

Reviewed By: {gmackall}

This change reverts the following previous change:
Original Description:
This PR updates almost* all Gradle buildscripts in the Flutter repo the `example` and `dev` (in particular, in `dev/integration_tests` and in `dev/benchmarks`) directories to apply Flutter's Gradle plugins using the declarative `plugins {}` block.

*almost, because:
- add-to-app (aka hybrid) apps are not migrated (related https://github.com/flutter/flutter/issues/138756)
- apps that purposefully use build files to ensure backward compatibility (e.g. [`gradle_deprecated_settings`](https://github.com/flutter/flutter/tree/3.16.0/dev/integration_tests/gradle_deprecated_settings))
2024-02-04 14:28:18 +00:00
Bartek Pacia
85888bccf2
Update gradle lockfiles template (#140115)
This PR updates almost* all Gradle buildscripts in the Flutter repo the `example` and `dev` (in particular, in `dev/integration_tests` and in `dev/benchmarks`) directories to apply Flutter's Gradle plugins using the declarative `plugins {}` block.

*almost, because:
- add-to-app (aka hybrid) apps are not migrated (related https://github.com/flutter/flutter/issues/138756)
- apps that purposefully use build files to ensure backward compatibility (e.g. [`gradle_deprecated_settings`](https://github.com/flutter/flutter/tree/3.16.0/dev/integration_tests/gradle_deprecated_settings))
2024-02-04 13:10:49 +00:00
Jackson Gardner
ba626dc83a
Wasm/JS Dual Compile with the flutter tool (#141396)
This implements dual compile via the newly available flutter.js bootstrapping APIs for intelligent build fallback.
* Users can now use the `FlutterLoader.load` API from flutter.js
* Flutter tool injects build info into the `index.html` of the user so that the bootstrapper knows which build variants are available to bootstrap
* The semantics of the `--wasm` flag for `flutter build web` have changed:
  - Instead of producing a separate `build/web_wasm` directory, the output goes to the `build/web` directory like a normal web build
  - Produces a dual build that contains two build variants: dart2wasm+skwasm and dart2js+CanvasKit. The dart2wasm+skwasm will only work on Chrome in a cross-origin isolated context, all other environments will fall back to dart2js+CanvasKit.
  - `--wasm` and `--web-renderer` are now mutually exclusive. Since there are multiple build variants with `--wasm`, the web renderer cannot be expressed via a single command-line flag. For now, we are hard coding what build variants are produced with the `--wasm` flag, but I plan on making this more customizable in the future.
* Build targets now can optionally provide a "build key" which can uniquely identify any specific parameterization of that build target. This way, the build target can invalidate itself by changing its build key. This works a bit better than just stuffing everything into the environment defines because (a) it doesn't invalidate the entire build, just the targets which are affected and (b) settings for multiple build variants don't translate well to the flat map of environment defines.
2024-02-02 01:52:28 +00:00
Christopher Fujino
a80333349a
Unpin test (#141427)
Fixes https://github.com/flutter/flutter/issues/140169
2024-02-01 18:53:23 +00:00
Zachary Anderson
6a6874ecf9
Update Android minSdkVersion to 21 (#142267)
This PR increases Android's `minSdkVersion` to 21.

There are two changes in this PR aside from simply increasing the number
from 19 to 21 everywhere.

First, tests using `flutter_gallery` fail without updating the
lockfiles. The changes in the PR are the results of running
`dev/tools/bin/generate_gradle_lockfiles.dart` on that app.

Second, from
[here](https://developer.android.com/build/multidex#mdex-pre-l):
> if your minSdkVersion is 21 or higher, multidex is enabled by default
and you don't need the multidex library.

As a result, the `multidex` option everywhere is obsolete. This PR
removes all logic and tests related to that option that I could find.
`Google testing` and `customer_tests` pass on this PR, so it seems like
this won't be too breaking if it is at all. If needed I'll give this
some time to bake in the framework before landing the flutter/engine
PRs.

Context: https://github.com/flutter/flutter/issues/138117,
https://github.com/flutter/flutter/issues/141277, b/319373605
2024-01-29 09:49:09 -08:00
LongCatIsLooong
505845c5ac
Remove textScaleFactor references from flutter/flutter (#142271)
These should the the last remaining `MediaQueryData.textScaleFactor` and `TextScaler.textScaleFactor` references.
2024-01-26 19:12:24 +00:00
Matan Lurey
2f6fdf2650
Start renaming by adding a new bringup: true as an Android emulator. (#142257)
Part 2 of https://github.com/flutter/flutter/issues/142178.

Supersedes https://github.com/flutter/flutter/pull/142078.

Feedback welcome to avoid reverts!
2024-01-26 01:07:08 +00:00
auto-submit[bot]
db25540919
Reverts "Reverts "Rename integration_tests/external_ui but do not touch anything else..."" (#142268)
Reverts flutter/flutter#142265
Initiated by: matanlurey
This change reverts the following previous change:
Original Description:
Reverts flutter/flutter#142238
Initiated by: eliasyishak
This change reverts the following previous change:
Original Description:
Part of https://github.com/flutter/flutter/issues/142178.
2024-01-25 22:28:27 +00:00
auto-submit[bot]
f8544df0ea
Reverts "Rename integration_tests/external_ui but do not touch anything else..." (#142265)
Reverts flutter/flutter#142238
Initiated by: eliasyishak
This change reverts the following previous change:
Original Description:
Part of https://github.com/flutter/flutter/issues/142178.
2024-01-25 22:10:17 +00:00
Matan Lurey
f61d2f53c6
Rename integration_tests/external_ui but do not touch anything else... (#142238)
Part of https://github.com/flutter/flutter/issues/142178.
2024-01-25 13:08:16 -08:00
Matan Lurey
b3da19f879
Refactor external_ui without making any name changes (I think) (#142192)
Work towards https://github.com/flutter/flutter/issues/142178.

---

This PR makes no _behavioral_ changes to executed code, and instead
focuses on organization and naming:

1. Extended the README to explain the intent of the test, as well as how
to run it
1. Renamed `main.dart` and `main_test.dart` to `frame_rate_main.dart`
and `frame_rate_test.dart` (we'll add more)
1. Did some refactoring of the test to make it more obvious what is
being asserted (i.e. `widgetBuilds` and friends)
2024-01-24 17:14:16 -08:00
Polina Cherkasova
a522b38e96
Upgrade leak_tracker. (#142162) 2024-01-24 15:33:17 -08:00
auto-submit[bot]
54e9f2dbe6
Reverts "Refactor external_uiexternal_textures" (#142173)
Reverts flutter/flutter#142062
Initiated by: eliasyishak
This change reverts the following previous change:
Original Description:
This PR makes no _behavioral_ changes to executed code, and instead focuses on organization and naming:

1. Almost[^1] anything named `external_ui` is renamed `external_textures`
1. Extended the README to explain the intent of the test, as well as how to run it
1. Renamed `main.dart` and `main_test.dart` to `frame_rate_main.dart` and `frame_rate_test.dart` (we'll add more)
1. Did some refactoring of the test to make it more obvious what is being asserted (i.e. `widgetBuilds` and friends)

Given how complex (and in-flux) this directory is, I'm also requesting either John, Jonah or I review any changes.

[^1]: Except the name of the `.ci.yaml` task, i.e. `name: Linux_pixel_7pro external_ui_integration_test` because I'm apparently not able to change that without creating a new task as `bringup: true` and playing a bit of a dance. Maybe that's worth doing though (in future PRs)?
2024-01-24 21:41:17 +00:00
Matan Lurey
2e2042ff8e
Refactor external_uiexternal_textures (#142062)
This PR makes no _behavioral_ changes to executed code, and instead
focuses on organization and naming:

1. Almost[^1] anything named `external_ui` is renamed
`external_textures`
1. Extended the README to explain the intent of the test, as well as how
to run it
1. Renamed `main.dart` and `main_test.dart` to `frame_rate_main.dart`
and `frame_rate_test.dart` (we'll add more)
1. Did some refactoring of the test to make it more obvious what is
being asserted (i.e. `widgetBuilds` and friends)

Given how complex (and in-flux) this directory is, I'm also requesting
either John, Jonah or I review any changes.

[^1]: Except the name of the `.ci.yaml` task, i.e. `name:
Linux_pixel_7pro external_ui_integration_test` because I'm apparently
not able to change that without creating a new task as `bringup: true`
and playing a bit of a dance. Maybe that's worth doing though (in future
PRs)?
2024-01-24 12:44:31 -08:00
Ian Hickson
77c3807c80
Revert "Make tests more resilient to Skia gold failures and refactor flutter_goldens for extensive technical debt removal (#140101)" (#141814)
Reverts https://github.com/flutter/flutter/pull/140101

That PR somehow made non-matching gold tests not fail at HEAD.

Fixes https://github.com/flutter/flutter/issues/141880
- Blocked by https://github.com/flutter/flutter/issues/140169
  - https://github.com/flutter/flutter/pull/141427
2024-01-19 20:29:11 +00:00
Jenn Magder
90ced90f1b
Sort Swift imports in templates (#141487)
`swift-format` alphabetizes imports.  Alphabetize them in swift template files and integration tests.

I found this as part of https://github.com/flutter/flutter/issues/41129 running `swift-import` on packages.
2024-01-16 18:07:21 +00:00
OutdatedGuy
a8cb8af857
Added newline at end of .gitignore files (#141270)
Added missing required newline at end of some `.gitignore` files. All other `.gitignore` files ends with a newline except the changed ones, hence the PR.

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

**Not listing any issues because of trivial fixes as mentioned above.**
2024-01-12 23:22:11 +00:00
Anis Alibegić
81d80c587d
Fixed a lot of typos (#141431)
Fair amount of typos spotted and fixed. Some of them are in comments, some of them are in code and some of them are in nondart files.

There is no need for issues since it's a typo fix.

I have doubts about [packages/flutter_tools/lib/src/ios/core_devices.dart](https://github.com/flutter/flutter/compare/master...anisalibegic:flutter:master#diff-fdbc1496b4bbe7e2b445a567fd385677af861c0093774e3d8cc460fdd5b794fa), I have a feeling it might broke some things on the other end, even though it's a typo.
2024-01-12 22:10:25 +00:00
Christopher Fujino
9e9af67b9a
unpin web_socket_channel and roll pub packages (#141424)
Fixes https://github.com/flutter/flutter/issues/141032

We pinned to web_socket_channel v2.4.1 because v2.4.2 was retracted, however v2.4.3 is now available.
2024-01-12 19:13:08 +00:00
Camille Simon
5931b4f21d
Increase delay for checking integration_ui_keyboard_resize test success (#141301)
Increases delay for checking keyboard resizing to potentially accommodate the occasional longer delay of the Pixel 7 Pro.

Intended to address https://github.com/flutter/flutter/issues/140645.
2024-01-12 04:42:07 +00:00
Polina Cherkasova
1f3103e50d
Upgrade leak_tracker. (#141153) 2024-01-09 12:02:35 -08:00
Christopher Fujino
6edbce9e07
Manual pub roll pinning web socket channel (#141040)
Work around https://github.com/flutter/flutter/issues/141032

Otherwise a re-land of https://github.com/flutter/flutter/pull/140979

Fixes https://github.com/flutter/flutter/issues/137163 & https://github.com/flutter/flutter/issues/139181
2024-01-05 22:29:58 +00:00
auto-submit[bot]
c2286a7642
Reverts "manual pub roll to pick up dds fixes" (#141033)
Reverts flutter/flutter#140979
Initiated by: loic-sharma
This change reverts the following previous change:
Original Description:
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-05 19:10:19 +00:00
Christopher Fujino
e256d49117
manual pub roll to pick up dds fixes (#140979)
Fixes https://github.com/flutter/flutter/issues/137163
Fixes https://github.com/flutter/flutter/issues/139181
2024-01-04 19:43:06 +00:00
Jenn Magder
076cb8a328
Migrate Xcode projects last version checks to Xcode 15.1 (#140256)
Change the following in the `flutter create` templates.  I didn't make any auto-migrations for existing apps because none seem that critical:
1. Turn on `ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS` in iOS and macOS.
1. Turn on `BuildIndependentTargetsInParallel` in macOS template.  https://github.com/flutter/flutter/pull/125827/files#r1181817619 
1. Turn on `DEAD_CODE_STRIPPING` in macOS template. 
1. Set `ENABLE_USER_SCRIPT_SANDBOXING=NO` in iOS and macOS template.  `flutter` scripts don't work with this on.  This might require a migration in the future to explicitly turn this one off. However at least for now if the setting isn't present it defaults to `NO`.

Add migration for `LastUpgradeVersion` so users won't see these validation issues in Xcode.

Run migrator on all the example apps.  A few aren't Flutter apps so I edited them in Xcode.

Fixes https://github.com/flutter/flutter/issues/140253
See also https://github.com/flutter/flutter/issues/125817 and https://github.com/flutter/flutter/pull/90304.
2024-01-03 23:05:46 +00:00
John McCutchan
dcc2c91471
Verified input test take 2 (#140836)
This is a reland of https://github.com/flutter/flutter/pull/140806 which had an issue with package versions.
2024-01-03 01:17:08 +00:00
Jenn Magder
b08fc60024
Set template and migrate apps to iOS 12 minimum (#140823)
Reland https://github.com/flutter/flutter/pull/140478 with `ios_content_validation_test` test fix.
```
[ios_content_validation_test] Process terminated with exit code 0.
Task result:
{
  "success": true,
  "data": null,
  "detailFiles": [],
  "benchmarkScoreKeys": [],
  "reason": "success"
}

```

__________

1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-03 00:47:40 +00:00
auto-submit[bot]
8e431e106e
Reverts "Verified input integration test" (#140833)
Reverts flutter/flutter#140806
Initiated by: zanderso
This change reverts the following previous change:
Original Description:
This is an integration test associated with https://github.com/flutter/engine/pull/49268
2024-01-02 22:44:18 +00:00
John McCutchan
ac9a8eb669
Verified input integration test (#140806)
This is an integration test associated with
https://github.com/flutter/engine/pull/49268
2024-01-02 14:20:35 -08:00
Polina Cherkasova
45c611f040
Upgrade leak_tracker. (#140758) 2024-01-02 20:58:16 +00:00
auto-submit[bot]
bd634f3298
Reverts "Set template and migrate apps to iOS 12 minimum" (#140822)
Reverts flutter/flutter#140478
Initiated by: loic-sharma
This change reverts the following previous change:
Original Description:
1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-02 20:49:19 +00:00
Jenn Magder
acdbcadb9e
Set template and migrate apps to iOS 12 minimum (#140478)
1. Change templates to `IPHONEOS_DEPLOYMENT_TARGET`, `MinimumOSVersion`, and Podfile `platform :ios` to 12.0.
2. Add migrator for Podfile part to migrate `platform :ios, '11.0'` -> `platform :ios, '12.0'`
3. Compile with `-miphoneos-version-min=12.0`
4. Run the migrator on all example apps and integration tests.

See also https://github.com/flutter/flutter/pull/62902 and https://github.com/flutter/flutter/pull/85174 and https://github.com/flutter/flutter/pull/101963

Fixes https://github.com/flutter/flutter/issues/136060
2024-01-02 19:42:13 +00:00
flutter-pub-roller-bot
2d75f76b44
Roll pub packages (#140472)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-20 22:57:21 +00:00
Michael Goderbauer
c4fda23393
Remove outdated ignores from framework (#140465)
These were not ignoring anything (anymore).
2023-12-20 22:05:29 +00:00
Gustl22
da0cd69659
Revert automated changes made to deprecated settings.gradle (plugins.each) (#140037)
Restore testing deprecated settings.gradle (plugins.each).

Updated presumably by accident in #83067

Split from #137115
See also https://github.com/flutter/flutter/pull/137115#issuecomment-1781909865
2023-12-20 15:45:08 +00:00
Bartek Pacia
a1e1dc3f6c
Reland "Warn when Gradle plugins are applied using the legacy apply script method (#140103)
> This PR relands #139690 which was reverted in #140102

This PR adds a deprecation message when Android build is using the legacy "apply script method" way of applying Flutter's Gradle plugins (that is: [`flutter.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/flutter.gradle) and [`app_plugin_loader.gradle`](https://github.com/flutter/flutter/blob/3.16.0/packages/flutter_tools/gradle/app_plugin_loader.gradle)).

See also:
- #121541
  - in particular https://github.com/flutter/flutter/issues/121541#issuecomment-1836947311
- #135392
  - and PR that add the migration guide: [#9857](https://github.com/flutter/website/pull/9857)

- I think either `logger.error` or `logger.quiet` must be used, because all other error levels are not shown during `flutter build apk` (and that's what most people use).
2023-12-19 16:03:23 +00:00
Polina Cherkasova
6368d65622
Upgrade to version of leak tracker that does not depend on test_widgets. (#140247)
Contributes to: https://github.com/flutter/flutter/issues/135856
2023-12-19 04:28:09 +00:00
Andrew Kolos
f8b9748661
Restore and fix flavors_test_macos (#139841)
Partially resolves[^1] https://github.com/flutter/flutter/issues/139774.

Effectively reverts https://github.com/flutter/flutter/pull/125581.

The main change here is that I deleted and recreated the macos Xcode project for this integration test (hence the large diff). I tried fixing the existing project first, but it was set up quite differently, and—for whatever reason—the integration test would get stuck trying to load `dev/integration_tests/flavors/integration_test/integration_test.dart`.

I verified that this works locally, but I don't know if it's possible to run this on the devicelab try pool to verify that it works on devicelab hardware.

[^1]: I would not close the issue until 1) this PR lands, 2) the integration test consistently passes on CI, and 3) macOS support for flavors is publicly documented.
2023-12-18 08:52:22 +00:00
Polina Cherkasova
bda158adf0
Reorganize dependencies on leak_tracker. (#140233)
1. Move leak_tracker and leak_tracker_testing out of direct dependencies.
2. Move leak_tracker_flutter_testing from dev to prod dependencies for flutter_test

It is prerequisite for https://github.com/flutter/flutter/issues/135856
2023-12-15 19:33:23 +00:00
Srujan Gaddam
2407f699e9
Move package:web dependency to dev dependency (#139696)
Pinning the package:web dependency constrains downstream packages from
using newer versions and making sure they support the version pinned in
Flutter. Since the usage of package:web in Flutter is light, we should
instead have a small shim like the engine and keep package:web as a dev
dependency only.
2023-12-15 08:53:27 -08:00
Polina Cherkasova
6a85684877
Increase versions of leak tracker libraries. (#140018)
Contributes to https://github.com/flutter/flutter/issues/135856
2023-12-15 05:18:23 +00:00
Andrew Kolos
935775cb74
[reland] Support conditional bundling of assets based on --flavor (#139834)
Reland of https://github.com/flutter/flutter/pull/132985. Fixes the path to AssetManifest.bin in flavors_test_ios
2023-12-14 05:30:10 +00:00
Daco Harkes
3b370c8539
[deps] update Android SDK to 34 (#138183)
Update Android SDK from 33 to 34.

Following the engine update:

* https://github.com/flutter/engine/pull/47839
2023-12-14 00:55:57 +00:00
Reid Baker
3c80cc7eb9
Do not use project in do last (#139325)
- Use copy task that branches for 8.3 and above to avoid using project.exec in a dolast block. 

part 1/n for flutter/flutter/issues/138523 

This PR does not test the 8.3 branch but instead builds the ability to write a branching gradle test. 
After fixing this project.exec action there I discovered a second that needs to be removed or migrated in order for the build to work. 

Related reading https://docs.gradle.org/8.0/userguide/configuration_cache.html#config_cache:requirements
https://docs.gradle.org/current/javadoc/org/gradle/process/ExecOperations.html (not used but considered) 
https://docs.gradle.org/8.2/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:fileMode
2023-12-13 23:47:58 +00:00
flutter-pub-roller-bot
8791b0ea1e
Roll pub packages (#140024)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-13 23:47:56 +00:00
flutter-pub-roller-bot
eb0890c9da
Roll pub packages (#139995)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-12 20:06:00 +00:00
Jason Simmons
da891d64c0
Update Gallery lockfiles for the new version of the video_player plugin (#139832)
The video_player plugin was rolled in https://github.com/flutter/flutter/pull/139203 and the lockfiles need to be updated to match
2023-12-12 16:17:24 +00:00
hgraceb
4252aa0fff
Improve slider's value indicator display test (#139198)
The previous test for #128137 does not effectively regress and verify #123313 because the issue is specific to desktop platforms.
2023-12-11 17:34:21 +00:00
flutter-pub-roller-bot
a5acec1b8d
Roll pub packages (#139811)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-08 17:28:31 +00:00
auto-submit[bot]
21766a4f9f
Reverts "Support conditional bundling of assets based on --flavor" (#139787)
Reverts flutter/flutter#132985
Initiated by: christopherfujino
This change reverts the following previous change:
Original Description:
Provides support for conditional bundling of assets through the existing `--flavor` option for `flutter build` and `flutter run`. Closes https://github.com/flutter/flutter/issues/21682. Resolves https://github.com/flutter/flutter/issues/136092

## Change
Within the `assets` section pubspec.yaml, the user can now specify one or more `flavors` that an asset belongs to. Consider this example:

```yaml
# pubspec.yaml
flutter:
  assets:
    - assets/normal-asset.png
    - path: assets/vanilla/ice-cream.png
      flavors: 
        - vanilla
    - path: assets/strawberry/ice-cream.png
      flavors:
        - strawberry
```

With this pubspec,
* `flutter run --flavor vanilla` will not include `assets/strawberry/ice-cream.png` in the build output.
* `flutter run --flavor strawberry` will not include `assets/vanilla/ice-cream.png`.
* `flutter run` will only include `assets/normal-asset.png`.

## Open questions

* Should this be supported for all platforms, or should this change be limited to ones with documented `--flavor` support (Android, iOS, and (implicitly) MacOS)? This PR currently only enables this feature for officially supported platforms.

## Design thoughts, what this PR does not do, etc.

### This does not provide an automatic mapping/resolution of asset keys/paths to others based on flavor at runtime.

The implementation in this PR represents a simplest approach. Notably, it does not give Flutter the ability to dynamically choose an asset based on flavor using a single asset key. For example, one can't use `Image.asset('config.json')` to dynamically choose between different "flavors" of `config.json` (such as `dev-flavor/config.json` or `prod-flavor/config.json`). However, a user could always implement such a mechanism in their project or in a library by examining the flavor at runtime.

### When multiple entries affect the same file and 1) at least one of these entries have a `flavors` list provided and 2) these lists are not equivalent, we always consider the manifest to be ambiguous and will throw a `ToolExit`. 

<details>
For example, these manifests would all be considered ambiguous:

```yaml
assets:
  - assets/
  - path: assets/vanilla.png
    flavors: 
      - vanilla

assets:
  - path: assets/vanilla/
    flavors: 
      - vanilla
  - path: assets/vanilla/cherry.png
     flavor:
      - cherry

# Thinking towards the future where we might add glob/regex support and more conditions other than flavor:
assets:
  - path: assets/vanilla/**
    flavors:
      - vanilla
  - path: assets/**/ios/**
    platforms: 
       - ios

# Ambiguous in the case of assets like "assets/vanilla/ios/icon.svg" since we 
# don't know if flavor `vanilla` and platform `ios` should be combined using or-logic or and-logic.
```

See [this review comment thread](https://github.com/flutter/flutter/pull/132985#discussion_r1381909942) for the full story on how I arrived at this decision.
</details>

### This does not support Android's multidimensional flavors feature (in an intuitive way)

<details>

Conder this excerpt from a Flutter project's android/app/build.gradle file:

```groovy
android {
    // ...

    flavorDimensions "mode", "api"

    productFlavors {
        free {
            dimension "mode"
            applicationIdSuffix ".free"
        }

        premium {
            dimension "mode"
            applicationIdSuffix ".premium"
        }

        minApi23 {
            dimension "api"
            versionNameSuffix "-minApi23"
        }

        minApi21 {
            dimension "api"
            versionNameSuffix "-minApi21"
        }
    }
}
```

In this setup, the following values are valid `--flavor` are valid `freeMinApi21`, `freeMinApi23`, `premiumMinApi21`, and `premiumMinApi23`. We call these values "flavor combinations". Consider the following from the Android documentation[^1]:

> In addition to the source set directories you can create for each individual product flavor and build variant, you can also create source set directories for each combination of product flavors. For example, you can create and add Java sources to the src/demoMinApi24/java/ directory, and Gradle uses those sources only when building a variant that combines those two product flavors.
> 
> Source sets you create for product flavor combinations have a higher priority than source sets that belong to each individual product flavor. To learn more about source sets and how Gradle merges resources, read the section about how to [create source sets](https://developer.android.com/build/build-variants#sourcesets).

This feature will not behave in this way. If a user utilizes this feature and also Android's multidimensional flavors feature, they will have to list out all flavor combinations that contain the flavor they want to limit an asset to:

```yaml
assets:
  - assets/free/
    flavors:
      - freeMinApi21
      - freeMinApi23
```

This is mostly due to a technical limitation in the hot-reload feature of `flutter run`. During a hot reload, the tool will try to update the asset bundle on the device, but the tool does not know the flavors contained within the flavor combination (that the user passes to `--flavor`). Gradle is the source of truth of what flavors were involved in the build, and `flutter run` currently does not access to that information since it's an implementation detail of the build process. We could bubble up this information, but it would require a nontrivial amount of engineering work, and it's unclear how desired this functionality is. It might not be worth implementing.

</details>

See https://flutter.dev/go/flavor-specific-assets for the (outdated) design document. 

<summary>Pre-launch Checklist</summary>

</details>

[^1]: https://developer.android.com/build/build-variants#flavor-dimensions
2023-12-08 06:40:28 +00:00
Andrew Kolos
016eb85177
Support conditional bundling of assets based on --flavor (#132985)
Provides support for conditional bundling of assets through the existing `--flavor` option for `flutter build` and `flutter run`. Closes https://github.com/flutter/flutter/issues/21682. Resolves https://github.com/flutter/flutter/issues/136092

## Change
Within the `assets` section pubspec.yaml, the user can now specify one or more `flavors` that an asset belongs to. Consider this example:

```yaml
# pubspec.yaml
flutter:
  assets:
    - assets/normal-asset.png
    - path: assets/vanilla/ice-cream.png
      flavors: 
        - vanilla
    - path: assets/strawberry/ice-cream.png
      flavors:
        - strawberry
```

With this pubspec,
* `flutter run --flavor vanilla` will not include `assets/strawberry/ice-cream.png` in the build output.
* `flutter run --flavor strawberry` will not include `assets/vanilla/ice-cream.png`.
* `flutter run` will only include `assets/normal-asset.png`.

## Open questions

* Should this be supported for all platforms, or should this change be limited to ones with documented `--flavor` support (Android, iOS, and (implicitly) MacOS)? This PR currently only enables this feature for officially supported platforms.

## Design thoughts, what this PR does not do, etc.

### This does not provide an automatic mapping/resolution of asset keys/paths to others based on flavor at runtime.

The implementation in this PR represents a simplest approach. Notably, it does not give Flutter the ability to dynamically choose an asset based on flavor using a single asset key. For example, one can't use `Image.asset('config.json')` to dynamically choose between different "flavors" of `config.json` (such as `dev-flavor/config.json` or `prod-flavor/config.json`). However, a user could always implement such a mechanism in their project or in a library by examining the flavor at runtime.

### When multiple entries affect the same file and 1) at least one of these entries have a `flavors` list provided and 2) these lists are not equivalent, we always consider the manifest to be ambiguous and will throw a `ToolExit`. 

<details>
For example, these manifests would all be considered ambiguous:

```yaml
assets:
  - assets/
  - path: assets/vanilla.png
    flavors: 
      - vanilla

assets:
  - path: assets/vanilla/
    flavors: 
      - vanilla
  - path: assets/vanilla/cherry.png
     flavor:
      - cherry

# Thinking towards the future where we might add glob/regex support and more conditions other than flavor:
assets:
  - path: assets/vanilla/**
    flavors:
      - vanilla
  - path: assets/**/ios/**
    platforms: 
       - ios

# Ambiguous in the case of assets like "assets/vanilla/ios/icon.svg" since we 
# don't know if flavor `vanilla` and platform `ios` should be combined using or-logic or and-logic.
```

See [this review comment thread](https://github.com/flutter/flutter/pull/132985#discussion_r1381909942) for the full story on how I arrived at this decision.
</details>

### This does not support Android's multidimensional flavors feature (in an intuitive way)

<details>

Conder this excerpt from a Flutter project's android/app/build.gradle file:

```groovy
android {
    // ...

    flavorDimensions "mode", "api"

    productFlavors {
        free {
            dimension "mode"
            applicationIdSuffix ".free"
        }

        premium {
            dimension "mode"
            applicationIdSuffix ".premium"
        }

        minApi23 {
            dimension "api"
            versionNameSuffix "-minApi23"
        }

        minApi21 {
            dimension "api"
            versionNameSuffix "-minApi21"
        }
    }
}
```

In this setup, the following values are valid `--flavor` are valid `freeMinApi21`, `freeMinApi23`, `premiumMinApi21`, and `premiumMinApi23`. We call these values "flavor combinations". Consider the following from the Android documentation[^1]:

> In addition to the source set directories you can create for each individual product flavor and build variant, you can also create source set directories for each combination of product flavors. For example, you can create and add Java sources to the src/demoMinApi24/java/ directory, and Gradle uses those sources only when building a variant that combines those two product flavors.
> 
> Source sets you create for product flavor combinations have a higher priority than source sets that belong to each individual product flavor. To learn more about source sets and how Gradle merges resources, read the section about how to [create source sets](https://developer.android.com/build/build-variants#sourcesets).

This feature will not behave in this way. If a user utilizes this feature and also Android's multidimensional flavors feature, they will have to list out all flavor combinations that contain the flavor they want to limit an asset to:

```yaml
assets:
  - assets/free/
    flavors:
      - freeMinApi21
      - freeMinApi23
```

This is mostly due to a technical limitation in the hot-reload feature of `flutter run`. During a hot reload, the tool will try to update the asset bundle on the device, but the tool does not know the flavors contained within the flavor combination (that the user passes to `--flavor`). Gradle is the source of truth of what flavors were involved in the build, and `flutter run` currently does not access to that information since it's an implementation detail of the build process. We could bubble up this information, but it would require a nontrivial amount of engineering work, and it's unclear how desired this functionality is. It might not be worth implementing.

</details>

See https://flutter.dev/go/flavor-specific-assets for the (outdated) design document. 

<summary>Pre-launch Checklist</summary>

</details>

[^1]: https://developer.android.com/build/build-variants#flavor-dimensions
2023-12-07 23:50:00 +00:00
Camille Simon
1fa54ea90a
[Android] Bump template & integration test Gradle version to 7.6.4 (#139276)
Updates Gradle version for Flutter project templates and integration tests to at least 7.6.3 (changed all of those with versions below it) to fix security vulnerability.

Part of fix for https://github.com/flutter/flutter/issues/138336.
2023-12-07 18:31:20 +00:00
flutter-pub-roller-bot
a390193b8a
Roll pub packages (#139739)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-07 16:46:23 +00:00
Ian Hickson
fca7bc9e28
Roll dependencies (#139606)
test-exempt: rolling dependencies
2023-12-06 19:22:06 +00:00
flutter-pub-roller-bot
935c8e8efe
Roll pub packages (#139510)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-12-05 20:23:54 +00:00
Gray Mackall
4ce5421ca9
Update generate_gradle_lockfiles script to represent newer templates, and run it on dev/ (#135175)
Upgrades agp versions and lockfiles for `dev/`. Also changes the lockfile generation script to represent the newer form of the `settings.gradle` template, and therefore also propagates these changes.

~~Potentially related to https://github.com/flutter/flutter/issues/134419~~, but worth doing anyways. (not actually related)
2023-12-05 18:04:08 +00:00
Mitchell Goodwin
e84f1296ac
Refactor to use Apple system fonts (#137275)
Addresses #63507, and is a follow up to the engine PR https://github.com/flutter/engine/pull/46857

Changes the font family string when attempting to use Apple system fonts to the new proxies added by the engine. For the "Text" font this will be more secure in the future against possible changes to Apple's API. For the "Display" font, this will now work correctly when it didn't before.

I checked the letter spacing values against a native app for all font sizes between 17-28. I made a few adjustments to better match native, but especially for the "Text" font we were either really close, or close enough to not make a large breaking change to default fonts worth it.

| Before  | After |
| ------------- | ------------- |
| <img width="466" alt="Screenshot 2023-11-02 at 11 45 12 AM" src="https://github.com/flutter/flutter/assets/58190796/627ed8ac-d848-4f71-aa62-a467b8aac62d"> | <img width="383" alt="Screenshot 2023-11-02 at 11 46 25 AM" src="https://github.com/flutter/flutter/assets/58190796/9a502021-7d2b-4e14-98f1-86971b3830a5"> |

The smaller text in both the before and after should be the same. The large system font that Flutter used before was incorrect, which caused it to look more spread out. Now we use the correct font.
2023-11-29 21:03:32 +00:00
Ian Hickson
b417812547
Roll dependencies (#139203)
Removes video_player and scoped_model pins, rolls everything else to latest.
2023-11-29 20:12:59 +00:00
auto-submit[bot]
20eb3ea131
Reverts "Reland Add platform view wide gamut test" (#139189)
Reverts flutter/flutter#139101
Initiated by: jonahwilliams
This change reverts the following previous change:
Original Description:
Reland of https://github.com/flutter/flutter/pull/138837

I reverted too many config files, the app needed the pbx project file in order to find the new class I added. Instead, just put the new platform view in the app delegate so it builds.
2023-11-29 00:58:17 +00:00
Nate
3267fbc07a
Implement switch expressions in dev/ (#139048)
I previously made a PR (#136140) that used `switch` expressions to make some parts of the Flutter codebase easier to understand. It was assigned to the framework team, and @christopherfujino let me know that it was too large to effectively review and recommended breaking it up into smaller pull requests.

Here's a PR that only targets files in the `dev/` directory. Hopefully this will be easier to work with!

(solves issue https://github.com/flutter/flutter/issues/136139)
2023-11-28 23:40:28 +00:00
Jonah Williams
2150424cee
Reland Add platform view wide gamut test (#139101)
Reland of https://github.com/flutter/flutter/pull/138837

I reverted too many config files, the app needed the pbx project file in order to find the new class I added. Instead, just put the new platform view in the app delegate so it builds.
2023-11-28 02:23:21 +00:00
auto-submit[bot]
e6a49f8a24
Reverts "Wide gamut and platform view integration test." (#139100)
Reverts flutter/flutter#138837
Initiated by: jonahwilliams
This change reverts the following previous change:
Original Description:
In https://github.com/flutter/engine/pull/48190 I discovered that overlay surfaces were not constructed with wide gamut settings. This adds a test that will fail until this is fixed.
2023-11-27 22:25:26 +00:00
Jonah Williams
389ebd4666
Wide gamut and platform view integration test. (#138837)
In https://github.com/flutter/engine/pull/48190 I discovered that overlay surfaces were not constructed with wide gamut settings. This adds a test that will fail until this is fixed.
2023-11-27 21:14:08 +00:00
Bruno Leroux
dcdf72a670
[flutter_tools] - Add queries section to Android manifest file (#137207)
## Description

This PR adds a new section to the Android manifest file.
This section is required for https://github.com/flutter/engine/pull/44579 (because it uses `PackageManager.queryIntentActivities` API ), see:

1. https://developer.android.com/training/package-visibility?hl=en
2. https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT
3. https://developer.android.com/reference/android/content/pm/PackageManager?hl=en#queryIntentActivities(android.content.Intent,%20android.content.pm.PackageManager.ResolveInfoFlags)

## Related Issue

Android manifest update for https://github.com/flutter/flutter/issues/107603

## Tests

This PR updates the integration tests and examples Android manifest files, this will help catch error or warning related to this change.
2023-11-16 08:57:20 +00:00
Srujan Gaddam
d8ffc7390c
Pin package:web 0.4.0 (#138428)
This version is needed so that dart:js_interop can move to extension
types. Also adds some code to handle some breaking changes:

- Body -> Response. Body was an IDL interface mixin type we exposed in
dart:html. Going forward, users should either use Request or Response.
- Casts to JSAny. These are temporary until we move package:web types to
extension types. Currently, package:web types can't implement JSObject
as JSObject will move to be an extension type itself.

Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
2023-11-15 15:03:21 -08:00
Polina Cherkasova
793827d98a
Upgrade leak tracker. (#138283) 2023-11-13 09:47:55 -08:00
Camille Simon
c66bb0a18a
[Android] Support Android 34 (take 2) (#137967)
Re-lands https://github.com/flutter/flutter/pull/137191.

The fix for the issue causing that PR to be reverted was tested in this PR but ultimately landed separately in https://github.com/flutter/flutter/pull/138093.
2023-11-09 22:40:15 +00:00
Michael Goderbauer
8a0f9118ea
Remove unused generic type from BottomSheet (#137791)
Fixes https://github.com/flutter/flutter/issues/137424.

The generic type argument was unused.
2023-11-03 22:25:37 +00:00
auto-submit[bot]
c4ce9479bb
Reverts "[Android] Support Android 34" (#137865)
Reverts flutter/flutter#137191
Initiated by: camsim99
This change reverts the following previous change:
Original Description:
Adds support for Android 34 in the following ways:

- Bumps integration tests compile SDK versions 33 --> 34
- Bumps template compile SDK version 33 --> 34
- Also changes deprecated `compileSdkVersion` to `compileSdk`

Part of https://github.com/flutter/flutter/issues/134220
2023-11-03 20:14:19 +00:00
Matej Knopp
62bd4874fd
[web] dispatch corresponding keyup events in text editing integrations (#136874)
https://github.com/flutter/engine/pull/46829 changed event handling
sequence on web so that KeyboardBinding/RawKeyboard handles the text
event first before it reaches IME. That means when dispatching
synthetised events to IME every keydown event must have a corresponding
keyup, otherwise consistency assertions in `KeyboardBindings` are
triggered.

## 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
2023-11-03 14:44:14 +01:00
Polina Cherkasova
e1b420cd5b
Upgrade leak_tracker and remove some deps in allow list. (#137806) 2023-11-03 06:20:47 -07:00
Camille Simon
675fec805a
[Android] Support Android 34 (#137191)
Adds support for Android 34 in the following ways:

- Bumps integration tests compile SDK versions 33 --> 34
- Bumps template compile SDK version 33 --> 34
- Also changes deprecated `compileSdkVersion` to `compileSdk`

Part of https://github.com/flutter/flutter/issues/134220
2023-11-02 22:18:11 +00:00
Michael Goderbauer
b09c70a913
Fix mounted checks (#137778)
Fixes in preparation for https://dart-review.googlesource.com/c/sdk/+/330561.

The change referenced above tightens the `use_build_context_synchronously` to ensure that `mounted` is checked on the appropriate `BuildContext` or `State`. This change fixes up the flutter/flutter in preparation of this new enforcement.
2023-11-02 18:21:55 +00:00
Polina Cherkasova
d50f1fa9c9
Add dependency on leak_tracker and leak_tracker_testing to flutter_test. (#137646) 2023-10-31 19:19:12 -07:00
flutter-pub-roller-bot
c9e9c085f5
Roll pub packages (#137650)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-11-01 00:11:53 +00:00
Polina Cherkasova
bcf267359c
Move dependency on leak_tracker from dependencies to dev_dependencies in flutter_test. (#137633)
Analyzer's dependency on autosnapshotting causes issues.

Because every version of integration_test from sdk depends on leak_tracker from hosted and autosnapshotting depends on leak_tracker from path, integration_test from sdk is forbidden.
So, because autosnapshotting depends on integration_test from sdk, version solving failed.
2023-10-31 21:12:52 +00:00
David Iglesias
15ccf24d79
[web] Add 'nonce' prop to flutter.js loadEntrypoint (#137204)
## Description

This PR adds a `nonce` parameter to flutter.js' `loadEntrypoint` method.

When set, loadEntrypoint will add a `nonce` attribute to the `main.dart.js` script tag, which allows Flutter to run in environments slightly more restricted by CSP; those that don't add `'self'` as a valid source for `script-src`.

----

### CSP directive

After this change, the CSP directive for a Flutter Web index.html can be:

```
script-src 'nonce-YOUR_NONCE_VALUE' 'wasm-unsafe-eval';
font-src https://fonts.gstatic.com;
style-src 'nonce-YOUR_NONCE_VALUE';
```

When CSP is set via a `meta` tag (like in the test accompanying this change), and to use a service worker, the CSP needs an additional directive: [`worker-src 'self';`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/worker-src)

When CSP set via response headers, the CSP that applies to `flutter_service_worker.js` is determined by its response headers. See **Web Workers API > [Content security policy](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#content_security_policy)** in MDN.)

----

### Initialization

If the CSP is set to disallow `script-src 'self'`, a nonce needs to also be passed to `loadEntrypoint`:

```javascript
  _flutter.loader.loadEntrypoint({
    nonce: 'SOME_NONCE',
    onEntrypointLoaded: (engineInitializer) async {
      const appRunner = await engineInitializer.initializeEngine({
        nonce: 'SOME_NONCE',
      });
      appRunner.runApp();
    },
  });
```

(`nonce` shows twice for now, because the entrypoint loader script doesn't have direct access to the `initializeEngine` call.)

----

## Tests

* Added a smoke test to ensure an app configured as described above starts.

## Issues

* Fixes https://github.com/flutter/flutter/issues/126977
2023-10-27 21:05:06 +00:00
Polina Cherkasova
dcbb2de0ad
Add dependency on leak_tracker to flutter_test. (#137069)
Contributes to: https://github.com/flutter/flutter/issues/135856

This PR also adds transitive dependency on  web_socket_channel, crypto, typed_data. `web_socket_channel` is needed to request retaining path for not GCed objects from VM Service. Two others are needed to serve web_socket_channel.

The dependency on leak_tracker is pinned:
aea562114c/packages/flutter_tools/lib/src/commands/update_packages.dart (L40)
2023-10-25 02:45:26 +00:00
Qun Cheng
ebc67643bd
Revert "Fix Gradle lockfiles." (#137198)
Reverts flutter/flutter#137190
2023-10-24 17:47:45 -07:00
Polina Cherkasova
ccbe221b3d
Fix Gradle lockfiles. (#137190) 2023-10-24 23:19:52 +00:00
flutter-pub-roller-bot
042e10510d
Roll pub packages (#137087)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-10-23 21:35:07 +00:00
flutter-pub-roller-bot
aea562114c
Roll pub packages (#137067)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-10-23 16:42:07 +00:00
flutter-pub-roller-bot
d7c82888c3
Roll pub packages (#136924)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-10-20 20:36:29 +00:00
Elliott Brooks
01eef7ca13
Upgrade Flutter deps to pull in latest vm_service and dwds (#136734)
Generated by running `flutter update-packages --force-upgrade`

Updates vm_service to [12.0.0](https://pub.dev/packages/vm_service/versions/12.0.0) and dwds to [22.0.0](https://pub.dev/packages/dwds/versions/22.0.0)

The changes to `packages/flutter_tools/lib/src/isolated/devfs_web.dart` are for the new interface of DWDS introduced in https://github.com/dart-lang/webdev/pull/2243

FYI @bkonyi
2023-10-19 18:29:02 +00:00
Michael Goderbauer
437361321a
Bump file,process,process_runner (#136418) 2023-10-12 13:05:24 -07:00
Kevin Moore
3e60999b11
Allow latest pkg:material_color_utilities (#132445)
* Allow latest pkg:material_color_utilities
* Bump other dependencies to their latest - including pkg:web
2023-10-11 23:57:16 +00:00
Polina Cherkasova
9d9f213eed
Upgrade leak_tracker to fix flackiness. (#135760)
Fixes: https://github.com/flutter/flutter/issues/135716
leak_tracker is left pinned because future updates are going to be breaking.
2023-09-29 18:55:21 +00:00
flutter-pub-roller-bot
b5c8fd11e4
Roll pub packages (#135455)
This PR was generated by `flutter update-packages --force-upgrade`.
2023-09-28 21:00:28 +00:00
Andrew Kolos
aa498cd51a
Add API to read flavor from framework at run time (#134179)
Resolves #128046.

Adds a services API that allows flutter app developers to write app code that determines `--flavor` the app was built with.

This is implemented by having the tool adding the value of `--flavor` to its list of dart environment declarations, which will be available to the app at run time. Specifically,`FLUTTER_APP_FLAVOR` is set. I chose this implementation for its simplicity. There is some precedent for this, but only for web ([example](cd2f3f5e78/packages/flutter_tools/lib/src/runner/flutter_command.dart (L1231))).
2023-09-28 17:38:54 +00:00
Tong Mu
203ec67c65
Fix violation of the render rule in Windows Startup Test (#134245)
This PR fixes yet another case in the windows startup test that violates the render rule, which caused https://github.com/flutter/engine/pull/45300 to be reverted.

Although the `FlutterView.render` call is within `onBeginFrame`, there is an `await` before the call, causing the call to fall out of the synchronous scope.

I've added this problem to the documentation of `FlutterView.render` in https://github.com/flutter/engine/pull/45555.
2023-09-21 17:43:07 +00:00
David Iglesias
a4bc894616
[deps] Update package:web dependency. (#135174)
This PR is the result of running:

```console
$ flutter upgrade-packages --force-upgrade
```

### Issues

* Fixes https://github.com/flutter/flutter/issues/135075
* Supersedes #135081
2023-09-20 22:55:52 +00:00
Michael Goderbauer
b0a90aee17
Enable strict-inference (#135043)
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-20 19:59:08 +00:00
Gray Mackall
f4b5fc1803
Unpin url launcher (remake) (#134958)
More up to date version of https://github.com/flutter/flutter/pull/133786.

Fixes https://github.com/flutter/flutter/issues/111304
2023-09-20 02:43:57 +00:00
LongCatIsLooong
ec47148036
[Windows_android channels_integration_test] Column -> ListView (#134836)
This should fix https://github.com/flutter/flutter/issues/134636. 

The column can get really tall, especially when there's line wrapping. This is the layout on a tablet, so on a motor g4 this column is likely going to overflow.

```
     RenderParagraph#66251 relayoutBoundary=up3
│ creator: RichText ← Text-[<'status'>] ← Column ←
│   FutureBuilder<TestStepResult> ← Padding ←
│   KeyedSubtree-[GlobalKey#0f29e] ← _BodyBuilder ← MediaQuery ←
│   LayoutId-[<_ScaffoldSlot.body>] ← CustomMultiChildLayout ←
│   _ActionsScope ← Actions ← ⋯
|  parentData: offset=Offset(0.0, 600.0); flex=null; fit=null
```

![flutter_01](https://github.com/flutter/flutter/assets/31859944/5e700d21-3c5e-4990-bfb5-153f44f1c517)
2023-09-15 19:53:24 +00:00
Pavel Mazhnik
783f2f4830
[web] provide serviceWorkerVersion to the getNewServiceWorker function (#131240)
Fixes https://github.com/flutter/flutter/issues/130212

Fix `Unresolved variable or type 'serviceWorkerVersion'` in the `_getNewServiceWorker` function.  

Supersedes https://github.com/flutter/flutter/pull/130206
2023-09-14 22:17:08 +00:00
Zachary Anderson
4d5a1d91e1
Bump gradle heap size limit in *everywhere* (#134665)
I'm seeing these in the bot reports every week. Hopefully this is all of
them, and hopefully 4GB is enough.
2023-09-13 10:36:24 -07:00
Michael Goderbauer
b966b2beee
Enable private field promotion for dev (#134480)
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
2023-09-12 18:29:00 +00:00
Daco Harkes
aa36db1d29
Native assets support for MacOS and iOS (#130494)
Support for FFI calls with `@Native external` functions through Native assets on MacOS and iOS. This enables bundling native code without any build-system boilerplate code.

For more info see:

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

### Implementation details for MacOS and iOS.

Dylibs are bundled by (1) making them fat binaries if multiple architectures are targeted, (2) code signing these, and (3) copying them to the frameworks folder. These steps are done manual rather than via CocoaPods. CocoaPods would have done the same steps, but (a) needs the dylibs to be there before the `xcodebuild` invocation (we could trick it, by having a minimal dylib in the place and replace it during the build process, that works), and (b) can't deal with having no dylibs to be bundled (we'd have to bundle a dummy dylib or include some dummy C code in the build file).

The dylibs are build as a new target inside flutter assemble, as that is the moment we know what build-mode and architecture to target.

The mapping from asset id to dylib-path is passed in to every kernel compilation path. The interesting case is hot-restart where the initial kernel file is compiled by the "inner" flutter assemble, while after hot restart the "outer" flutter run compiled kernel file is pushed to the device. Both kernel files need to contain the mapping. The "inner" flutter assemble gets its mapping from the NativeAssets target which builds the native assets. The "outer" flutter run get its mapping from a dry-run invocation. Since this hot restart can be used for multiple target devices (`flutter run -d all`) it contains the mapping for all known targets.

### Example vs template

The PR includes a new template that uses the new native assets in a package and has an app importing that. Separate discussion in: https://github.com/flutter/flutter/issues/131209.

### Tests

This PR adds new tests to cover the various use cases.

* dev/devicelab/bin/tasks/native_assets_ios.dart
  * Runs an example app with native assets in all build modes, doing hot reload and hot restart in debug mode.
* dev/devicelab/bin/tasks/native_assets_ios_simulator.dart
  * Runs an example app with native assets, doing hot reload and hot restart.
* packages/flutter_tools/test/integration.shard/native_assets_test.dart
  * Runs (incl hot reload/hot restart), builds, builds frameworks for iOS, MacOS and flutter-tester.
* packages/flutter_tools/test/general.shard/build_system/targets/native_assets_test.dart
  * Unit tests the new Target in the backend.
* packages/flutter_tools/test/general.shard/ios/native_assets_test.dart
* packages/flutter_tools/test/general.shard/macos/native_assets_test.dart
  * Unit tests the native assets being packaged on a iOS/MacOS build.

It also extends various existing tests:

* dev/devicelab/bin/tasks/module_test_ios.dart
   * Exercises the add2app scenario.
* packages/flutter_tools/test/general.shard/features_test.dart
   * Unit test the new feature flag.
2023-09-10 08:07:13 +00:00
Pierrick Bouvier
792e26df95
[Windows] Add target architecture to build path (#131843)
To implement windows-arm64 support, it is needed to add architecture as a subdirectory (https://github.com/flutter/flutter/issues/129805).

In short, when performing a flutter windows build, we have:
- Before: build/windows/runner/Release/gallery.exe
- After: build/windows/x64/runner/Release/gallery.exe

This convention follows what flutter linux build does.

Addresses: https://github.com/flutter/flutter/issues/129805
Addresses: https://github.com/flutter/flutter/issues/116196

Design doc: [flutter.dev/go/windows-arm64](https://flutter.dev/go/windows-arm64)
2023-08-31 09:09:02 -07:00