This adds a debugging utility that allows us to dump counts of the live
skwasm objects in debug mode. This is useful for understanding memory
leaks.
This is not code that runs in production or affects end users, so I'm
not bothering to write specific unit tests for this functionality.
---------
Co-authored-by: Kevin Moore <kevmoo@users.noreply.github.com>
## Description
Improved the `@Deprecated` message for `jumpToWithoutSettling` to
clarify the risks
and suggest appropriate alternatives like `jumpTo` or using a custom
`ScrollPosition`.
This makes the warning more informative for developers, in line with
Flutter's documentation practices.
## Checklist
- [x] Documentation-only change
- [x] No functional logic modified
- [x] Analysis and tests unaffected
This PR refactors Flutter widgets that use SizedBox for spacing between
children in Row into using the spacing parameter instead.
## 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].
- [x] 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.
- [x] All existing and new tests are passing.
Increase logging around libflutter.so. This adds debug logging to the
ReLinker load call as well as more logging in the error case. The split
and source dirs are added to the error message to improve
troubleshooting in the app bundle case. This does not fix the error of
not finding the libflutter.so file, just increases logging to hopefully
help devs find their problem.
Also, this fixes the unit tests which were not correctly getting the
exception in the given test.
Fixes: #168272
## 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.
Fixes#168252
## 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.
---------
Co-authored-by: Renzo Olivares <roliv@google.com>
## Description
This PR homogenizes `xxxTheme` and `xxxThemeData` classes documentation.
Mainly:
- Points to `xxxTheme.of` from `xxxThemeData` documentation instead of
using pseudo code (and add a code block in `xxxTheme.of` documentation
when it was missing.
- Fix `xxxTheme.of` documentation when the comment did not specify the
correct return type.
## Tests
Documentation only
Resolves https://github.com/flutter/flutter/issues/168846
This is a follow-up to https://github.com/flutter/flutter/pull/167677.
For apps that do not import `package:cupertino_icons`, the new on-device
button's icon shows up as a `[?]`.
This fix:
* adds an explicit dependency on `package:cupertino_icons` to the
framework
* imports `CupertinoIcons` into `lib/src/widgets/app.dart`
*Note: For some reason, adding the import to
`packages/flutter/lib/src/material/app.dart` and
`packages/flutter/lib/src/cupertino/app.dart` did not resolve the issue.
That's why I've added it to `lib/src/widgets/app.dart`, even though it's
not actually used in that file.*
**Let me know if this is acceptable!** (cc @Piinks) I'm guessing we
might not want to add a dependency on `cupertino_icons` to the Framework
(this might even be breaking change?) so if not, it might make sense to
use a different icon for the on-device inspector. Thanks!
Nearly all parts of the Impeller rendering pipeline now rely on DlPath
and PathSource objects for their path description needs. The impeller
path only exists for impeller's unit tests and benchmarks to have a
local way to construct paths. We implement path construction for the
DlPath object via DlPathBuilder which makes the impeller family of path
objects functionally obsolete and so they are now deleted.
This reverts commit 567162a91c872e9642faeedc15ee10535637da83.
`flutter_packaging` builders only should run on `stable` or `beta`, the
original definition was correct.
This should fix an error that I got in `Global generators` ->
`Debug-ios-Flutter.xcframework`:
https://ci.chromium.org/ui/p/flutter/builders/staging/Mac%20mac_ios_engine_ddm/1/overview
```
Cannot find iOS x64 simulator framework at /Volumes/Work/s/w/ir/cache/builder/engine/src/out/ci/ios_debug_sim_ddm/Flutter.framework`
```
I think what happened here is that I assumed I could skip the x64
simulator build because myself and other 1P developers are using arm64
macs. But I now see that the `Debug-ios-Flutter.xcframework` task and
the `flutter/sky/tools/create_ios_framework.py` script assumes both
architectures are present.
The link hooks (`hook/link.dart`) in Flutter have no access to the
resource identifier experiment for tree-shaking yet. That means we can
start running hooks earlier in the flutter build.
When we do get around to adding tree-shaking information, we should only
have a dependency on `KernelSnapshot` for AOT builds in which the Dart
tree-shaker runs. Likely achieved by splitting the `DartBuildForNative`
into two targets, one for Debug and one for Release. (Note, the names
for these targets are somewhat weird, so we should address that in
another PR as well. It should probably be called `RunDartHooks` or
something.)
I don't expect this PR to have any performance effect for fast hooks.
Other targets already run concurrently with this target:
```
$ flutter build -d macos --verbose
[ ] [ +278 ms] compile_macos_framework: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents: /Users/dacoharkes/flt/flutter/examples/hello_world/.dart_tool/flutter_build/ce2ba8b9e7204bce6beba11f20d6df36/app.dill,/Users/dacoharkes/flt/flutter/packages/flutter_tools/lib/src/build_system/targets/macos.dart,/Users/dacoharkes/flt/flutter/bin/cache/engine.stamp}
[...]
[ ] [ ] dart_build: Starting due to {}
[ ] [ +20 ms] No packages with native assets. Skipping native assets compilation.
[ ] [ +1 ms] dart_build: Complete
[ ] [ +1 ms] install_code_assets: Starting due to {}
[ ] [ +1 ms] Writing native assets json to file:///Users/dacoharkes/flt/flutter/examples/hello_world/.dart_tool/flutter_build/ce2ba8b9e7204bce6beba11f20d6df36/native_assets.json.
[ ] [ +1 ms] Writing /Users/dacoharkes/flt/flutter/examples/hello_world/.dart_tool/flutter_build/ce2ba8b9e7204bce6beba11f20d6df36/native_assets.json done.
[ ] [ ] install_code_assets: Complete
[ ] [+1376 ms] Building App.framework for x86_64...
[...]
[ ] [ +41 ms] compile_macos_framework: Complete
```
However, this PR makes the hooks already run concurrently with kernel
compilation, which always takes quite a while.
```
[ ] [ +2 ms] kernel_snapshot_program: Starting due to {}
[...]
[ ] [+2515 ms] release_unpack_macos: Complete
[ ] [+2425 ms] kernel_snapshot_program: Complete
```
This means that if the hooks do actual work, and enough cores on the
host are available for Dart compilation and hook execution, the result
will be quicker than before.
### Context
* https://github.com/dart-lang/native/issues/2236
### Testing
Existing native assets integration tests
### Benchmarks
Currently _not_ benchmarked. This will be benchmarked by the `flutter
build` and flutter-time-to-first-frame benchmarks once the experiment
flag is removed.
This worked before accidentally, presumably by using stale
source maps. Now that invocations in closures are transformed
by the compiler, the stale source maps are now invalid, leading
to timeouts in tests when running against the latest Dart SDK.
Skip this test instead until breakpoints work.
## 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].
- [ ] 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.
- [ ] All existing and new tests are passing.
Reduce the number of places where we convert flutter paint to DLpaint
and remove unused tonic overrides. Also does a pass on dl_paint/builder
to remove places we accidentally incremented/decrement shared_ptr ref
counts
This adds a new flavor of mac_ios_engine, which enables a build flag.
This is not part of the merge-queue since it's intended for experimental
and internal use at the moment.
Tested locally via `et build --config ci/mac_ios_engine_ddm`
This follows @sigmundch 's
https://github.com/flutter/flutter/pull/162855 which achieves the same
result for Android.
I branched `mac_ios_engine_ddm.json` and removed:
- x86 builds, seeing as I think we're all testing locally with arm64
macs now, and forge supports them as well (with a flag to force use of
arm64).
- All "extension safe" builds seeing as we aren't targeting watches at
this point.
- All "profile" flavor builds
<!-- start_original_pr_link -->
Reverts: flutter/flutter#165531
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Breaks google client tests
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: ash2moon
<!-- end_original_pr_author -->
<!-- start_reviewers -->
Reviewed By: {chunhtai, reidbaker, hannah-hyj}
<!-- end_reviewers -->
<!-- start_revert_body -->
This change reverts the following previous change:
Resolves partly https://github.com/flutter/flutter/issues/165510
**Context:** This issue originates from
https://github.com/flutter/flutter/issues/99715, where it was reported
that `liveRegion` alone was insufficient for announcing form validation
errors. While `liveRegion` announces the first error encountered,
subsequent submissions with the same error message on Android would not
trigger a re-announcement.
**Original Solution:** Pull request
https://github.com/flutter/flutter/pull/123373 addressed this by
implementing the `announce` event to ensure error messages were
consistently announced, even for repeated submissions.
**Native Android Behavior (Jetpack Compose):** In native Android
development using Jetpack Compose, setting the `isError` property of a
`TextField` to `true` triggers Talkback to announce "Error invalid
input." This announcement occurs *only* on the initial change to the
error state. Subsequent errors, even if the `isError` property remains
`true`, are not re-announced. This behavior closely mirrors the
functionality of `liveRegion`, with the key difference being that
`liveRegion` also announces the specific error text, in addition to the
general error state. Testing in a native Jetpack Compose application
confirms this behavior and provides a valuable comparison point against
the current Flutter form example.
**Suggested Action:** **Fork** the behavior in
https://github.com/flutter/flutter/pull/123373. Reinstate the use of
`liveRegion` for error announcements within `widgets/Form` for Android
and keep other platforms the same.
## 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/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
<!-- end_revert_body -->
Co-authored-by: auto-submit[bot] <flutter-engprod-team@google.com>
This PR is to make `BottomAppBarTheme` conform to Flutter Material's
conventions for component themes:
- Added a `BottomAppBarThemeData` class which defines overrides for the
defaults for `BottomAppBar` properties.
- Added `BottomAppBarTheme` constructor parameters:
`BottomAppBarThemeData? data` and `Widget? child`. This is now the
preferred way to configure a `BottomAppBarTheme`:
```dart
BottomAppBarTheme(
data: BottomAppBarThemeData(
color: xxx,
height: xxx,
elevation: xxx,
shape: xxx,
...
),
child: const BottomAppBar()
)
```
These two properties are made nullable to not break existing apps which
has customized `ThemeData.bottomAppBarTheme`.
- Update `BottomAppBarTheme` to be an `InheritedWidget` subclass.
- Changed the type of component theme defaults from `BottomAppBarTheme`
to `BottomAppBarThemeData`.
- Changed the `BottomAppBarTheme bottomAppBarTheme` property to
`BottomAppBarThemeData bottomAppBarTheme` in `ThemeData` and
`ThemeData.copyWith()`. This may cause breaking changes, a migration
guide will be created on website repo.
- Add new tests for `BottomAppBarThemeData` and update the existing
`BottomAppBarTheme` tests. And also turn to `true` for `useMaterial3`
(along with usages accordingly) at the common method `_withTheme()`
since `useMaterial3` is true by default.
- Addresses the "theme normalization" sub-project within #91772.
## 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/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
---------
Signed-off-by: huycozy <huy@nevercode.io>