forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Overlay portal paint transform builder #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
LongCatIsLooong
wants to merge
9
commits into
OverlayPortal-always-add-to-dirty-list
from
OverlayPortal-paint-transform-builder
Closed
Overlay portal paint transform builder #1
LongCatIsLooong
wants to merge
9
commits into
OverlayPortal-always-add-to-dirty-list
from
OverlayPortal-paint-transform-builder
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nt-transform-builder
…nt-transform-builder
…tal-paint-transform-builder
9 tasks
LongCatIsLooong
pushed a commit
that referenced
this pull request
Mar 3, 2025
The crash indicates that FlutterJNI is returning a nullptr SurfaceControl.Transaction. That likely indicates that we're trying to rasterize a frame before the platform view controller is setup. Potentially a startup race? At any rate, if the PVC is null that means there is no platform views - so it should be safe to create a tx on the fly. Interestingly I cannot repro this locally even on the same device. ``` [2025-02-11 21:50:37.462356] [STDOUT] stdout: [ +173 ms] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** [2025-02-11 21:50:37.462539] [STDOUT] stdout: [ ] Build fingerprint: 'google/cheetah/cheetah:13/TQ3A.230901.001/10750268:user/release-keys' [2025-02-11 21:50:37.462564] [STDOUT] stdout: [ ] Revision: 'MP1.0' [2025-02-11 21:50:37.463914] [STDOUT] stdout: [ +1 ms] ABI: 'arm64' [2025-02-11 21:50:37.463946] [STDOUT] stdout: [ ] Timestamp: 2025-02-11 21:57:42.183302140-0800 [2025-02-11 21:50:37.463959] [STDOUT] stdout: [ ] Process uptime: 3s [2025-02-11 21:50:37.464054] [STDOUT] stdout: [ ] Cmdline: dev.benchmarks.platform_views_layout [2025-02-11 21:50:37.464174] [STDOUT] stdout: [ ] pid: 15185, tid: 15246, name: 1.raster >>> dev.benchmarks.platform_views_layout <<< [2025-02-11 21:50:37.464354] [STDOUT] stdout: [ ] uid: 10250 [2025-02-11 21:50:37.464398] [STDOUT] stdout: [ ] tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) [2025-02-11 21:50:37.464440] [STDOUT] stdout: [ ] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000 [2025-02-11 21:50:37.464602] [STDOUT] stdout: [ ] Cause: null pointer dereference [2025-02-11 21:50:37.464651] [STDOUT] stdout: [ ] x0 b400007b82ff2e70 x1 000000000000002d x2 b400007c3309f370 x3 0000007abbcc6a23 [2025-02-11 21:50:37.464745] [STDOUT] stdout: [ ] x4 0000007a30d286b0 x5 0000007a4f6dd47b x6 0000000000000000 x7 61686b4b11ff3a78 [2025-02-11 21:50:37.464831] [STDOUT] stdout: [ ] x8 0000000000000000 x9 1417c2bd490e1f78 x10 0000000000000010 x11 000000000000009c [2025-02-11 21:50:37.464933] [STDOUT] stdout: [ ] x12 0000000000000adb x13 b400007ba2fe9510 x14 0000000000000e6b x15 b400007ba2fe9510 [2025-02-11 21:50:37.465012] [STDOUT] stdout: [ ] x16 0000000000000001 x17 0000000000000067 x18 0000007a2f996000 x19 b400007b82ff2e70 [2025-02-11 21:50:37.465082] [STDOUT] stdout: [ ] x20 000000000000002d x21 b400007ae3064b60 x22 b400007af30d0fa8 x23 0000000000000001 [2025-02-11 21:50:37.465155] [STDOUT] stdout: [ ] x24 0000007a30d2a000 x25 b400007b73028fb0 x26 0000007a3a22da20 x27 000000003b9bf6c8 [2025-02-11 21:50:37.465235] [STDOUT] stdout: [ ] x28 b400007af30d0fa8 x29 b400007ad3022cd0 [2025-02-11 21:50:37.465318] [STDOUT] stdout: [ ] lr 0000007a3a8c7918 sp 0000007a30d28940 pc 0000000000000000 pst 0000000040001000 [2025-02-11 21:50:37.465401] [STDOUT] stdout: [ ] backtrace: [2025-02-11 21:50:37.465491] [STDOUT] stdout: [ ] #00 pc 0000000000000000 <unknown> [2025-02-11 21:50:37.465596] [STDOUT] stdout: [ ] #1 pc 000000000088b914 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::PlatformViewAndroidJNIImpl::createTransaction()+104) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465688] [STDOUT] stdout: [ ] flutter#2 pc 000000000087f738 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0, std::_fl::allocator<flutter::AndroidSurfaceVKImpeller::SetNativeWindow(fml::RefPtr<flutter::AndroidNativeWindow>, std::_fl::shared_ptr<flutter::PlatformViewAndroidJNI> const&)::$_0>, impeller::android::SurfaceTransaction ()>::operator()()+16) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465785] [STDOUT] stdout: [ ] flutter#3 pc 0000000000bdbf1c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0, std::_fl::allocator<impeller::AHBSwapchainImplVK::AcquireNextDrawable()::$_0>, bool ()>::operator()()+1716) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465874] [STDOUT] stdout: [ ] flutter#4 pc 0000000000b1d180 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::SurfaceFrame::Submit()+148) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.465989] [STDOUT] stdout: [ ] flutter#5 pc 0000000000beb2b4 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfacesUnsafe(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+1284) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466400] [STDOUT] stdout: [ ] flutter#6 pc 0000000000beac58 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::DrawToSurfaces(flutter::FrameTimingsRecorder&, std::_fl::vector<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> >, std::_fl::allocator<std::_fl::unique_ptr<flutter::LayerTreeTask, std::_fl::default_delete<flutter::LayerTreeTask> > > >)+112) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466444] [STDOUT] stdout: [ ] flutter#7 pc 0000000000bec144 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0, std::_fl::allocator<flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)::$_0>, void (std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >)>::operator()(std::_fl::unique_ptr<flutter::FrameItem, std::_fl::default_delete<flutter::FrameItem> >&&)+192) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466468] [STDOUT] stdout: [ ] flutter#8 pc 0000000000bebc48 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (flutter::Rasterizer::Draw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> > const&)+360) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466521] [STDOUT] stdout: [ ] flutter#9 pc 0000000000bf9f7c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0>, std::_fl::allocator<fml::internal::CopyableLambda<flutter::Shell::OnAnimatorDraw(std::_fl::shared_ptr<flutter::Pipeline<flutter::FrameItem> >)::$_0> >, void ()>::operator()()+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466543] [STDOUT] stdout: [ ] flutter#10 pc 00000000008a09ec /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopImpl::RunExpiredTasksNow()+728) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466667] [STDOUT] stdout: [ ] flutter#11 pc 00000000008a4600 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::MessageLoopAndroid()::$_0::__invoke(int, int, void*)+84) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466746] [STDOUT] stdout: [ ] flutter#12 pc 0000000000011178 /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+808) (BuildId: 0b4a793fa8045c04066d988c68bac8bb) [2025-02-11 21:50:37.466784] [STDOUT] stdout: [ ] flutter#13 pc 00000000000185e4 /system/lib64/libandroid.so (ALooper_pollOnce+100) (BuildId: 682dab490c18361d5d6527bcdd86cdfa) [2025-02-11 21:50:37.466865] [STDOUT] stdout: [ ] flutter#14 pc 00000000008a470c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::MessageLoopAndroid::Run()+28) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466903] [STDOUT] stdout: [ ] flutter#15 pc 00000000008a283c /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (std::_fl::__function::__func<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0, std::_fl::allocator<fml::Thread::Thread(std::_fl::function<void (fml::Thread::ThreadConfig const&)> const&, fml::Thread::ThreadConfig const&)::$_0>, void ()>::operator()()+116) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.466943] [STDOUT] stdout: [ ] flutter#16 pc 00000000008a2670 /data/app/~~u9nRjz4bI1GoKFecw6gtbg==/dev.benchmarks.platform_views_layout-RoPBoOldhc38L7sINb2Vgg==/lib/arm64/libflutter.so (fml::ThreadHandle::ThreadHandle(std::_fl::function<void ()>&&)::$_0::__invoke(void*)+8) (BuildId: 8fab16f9507483301ef418db2c91ed06689696b1) [2025-02-11 21:50:37.467002] [STDOUT] stdout: [ ] flutter#17 pc 00000000000c226c /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c) [2025-02-11 21:50:37.467058] [STDOUT] stdout: [ ] flutter#18 pc 0000000000054a30 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c) [2025-02-11 21:50:37.525275] [STDOUT] stdout: [ +57 ms] 00:00 �[32m+0�[0m�[31m -1�[0m: scrolling performance test (setUpAll) �[1m�[31m[E]�[0m�[0m ```
LongCatIsLooong
pushed a commit
that referenced
this pull request
Apr 15, 2025
Currently when using a `CustomScrollView`, screen readers cannot list or
move focus to elements that are outside the current Viewport and cache
extent because we do not create semantic nodes for these elements.
This change introduces `SliverEnsureSemantics` which ensures its sliver
child is included in the semantics tree, whether or not it is currently
visible on the screen or within the cache extent. This way screen
readers are aware the elements are there and can navigate to them /
create accessibility traversal menus with this information.
* Under the hood a new flag has been added to `RenderSliver` called
`ensureSemantics`. `RenderViewportBase` uses this in its
`visitChildrenForSemantics` to ensure a sliver is visited when creating
the semantics tree. Previously a sliver was not visited if it was not
visible or within the cache extent. `RenderViewportBase` also uses this
in `describeSemanticsClip` and `describeApproximatePaintClip` to ensure
a sliver child that wants to "ensure semantics" is not clipped out if it
is not currently visible in the viewport or outside the cache extent.
* `RenderSliverMultiBoxAdaptor.semanticBounds` now leverages its first
child as an anchor for assistive technologies to be able to reach it if
the Sliver is a child of `SliverEnsureSemantics`. If not it will still
be dropped from the semantics tree.
* `RenderProxySliver` now considers child overrides of `semanticBounds`.
On the engine side we move from using a joystick method to scroll with
`SemanticsAction.scrollUp` and `SemanticsAction.scrollDown` to using
`SemanticsAction.scrollToOffset` completely letting the browser drive
the scrolling with its current dom scroll position "scrollTop" or
"scrollLeft". This is possible by calculating the total quantity of
content under the scrollable and sizing the scroll element based on
that.
<details open><summary>Code sample</summary>
```dart
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// Flutter code sample for [SliverEnsureSemantics].
void main() => runApp(const SliverEnsureSemanticsExampleApp());
class SliverEnsureSemanticsExampleApp extends StatelessWidget {
const SliverEnsureSemanticsExampleApp({super.key});
@OverRide
Widget build(BuildContext context) {
return const MaterialApp(home: SliverEnsureSemanticsExample());
}
}
class SliverEnsureSemanticsExample extends StatefulWidget {
const SliverEnsureSemanticsExample({super.key});
@OverRide
State<SliverEnsureSemanticsExample> createState() =>
_SliverEnsureSemanticsExampleState();
}
class _SliverEnsureSemanticsExampleState
extends State<SliverEnsureSemanticsExample> {
@OverRide
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
backgroundColor: theme.colorScheme.inversePrimary,
title: const Text('SliverEnsureSemantics Demo'),
),
body: Center(
child: CustomScrollView(
semanticChildCount: 106,
slivers: <Widget>[
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 0,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Steps to reproduce',
style: theme.textTheme.headlineSmall,
),
),
const Text('Issue description'),
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Expected Results',
style: theme.textTheme.headlineSmall,
),
),
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Actual Results',
style: theme.textTheme.headlineSmall,
),
),
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Code Sample',
style: theme.textTheme.headlineSmall,
),
),
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Screenshots',
style: theme.textTheme.headlineSmall,
),
),
Semantics(
header: true,
headingLevel: 3,
child: Text(
'Logs',
style: theme.textTheme.headlineSmall,
),
),
],
),
),
),
),
),
),
SliverFixedExtentList(
itemExtent: 44.0,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Item $index'),
),
);
},
childCount: 50,
semanticIndexOffset: 1,
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 51,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Semantics(
header: true,
child: const Text('Footer 1'),
),
),
),
),
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 52,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Semantics(
header: true,
child: const Text('Footer 2'),
),
),
),
),
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 53,
child: Semantics(link: true, child: const Text('Link #1')),
),
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 54,
child: OverflowBar(
children: <Widget>[
TextButton(
onPressed: () {},
child: const Text('Button 1'),
),
TextButton(
onPressed: () {},
child: const Text('Button 2'),
),
],
),
),
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 55,
child: Semantics(link: true, child: const Text('Link flutter#2')),
),
),
),
SliverEnsureSemantics(
sliver: SliverSemanticsList(
sliver: SliverFixedExtentList(
itemExtent: 44.0,
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Semantics(
role: SemanticsRole.listItem,
child: Card(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('Second List Item $index'),
),
),
);
},
childCount: 50,
semanticIndexOffset: 56,
),
),
),
),
SliverEnsureSemantics(
sliver: SliverToBoxAdapter(
child: IndexedSemantics(
index: 107,
child: Semantics(link: true, child: const Text('Link flutter#3')),
),
),
),
],
),
),
);
}
}
// A sliver that assigns the role of SemanticsRole.list to its sliver child.
class SliverSemanticsList extends SingleChildRenderObjectWidget {
const SliverSemanticsList({super.key, required Widget sliver})
: super(child: sliver);
@OverRide
RenderSliverSemanticsList createRenderObject(BuildContext context) =>
RenderSliverSemanticsList();
}
class RenderSliverSemanticsList extends RenderProxySliver {
@OverRide
void describeSemanticsConfiguration(SemanticsConfiguration config) {
super.describeSemanticsConfiguration(config);
config.role = SemanticsRole.list;
}
}
```
</details>
Fixes: flutter#160217
## 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 <[email protected]>
LongCatIsLooong
pushed a commit
that referenced
this pull request
Apr 15, 2025
<!-- start_original_pr_link --> Reverts: flutter#165589 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: Renzo-Olivares <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: breaking internal tests <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: Renzo-Olivares <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {Piinks} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Currently when using a `CustomScrollView`, screen readers cannot list or move focus to elements that are outside the current Viewport and cache extent because we do not create semantic nodes for these elements. This change introduces `SliverEnsureSemantics` which ensures its sliver child is included in the semantics tree, whether or not it is currently visible on the screen or within the cache extent. This way screen readers are aware the elements are there and can navigate to them / create accessibility traversal menus with this information. * Under the hood a new flag has been added to `RenderSliver` called `ensureSemantics`. `RenderViewportBase` uses this in its `visitChildrenForSemantics` to ensure a sliver is visited when creating the semantics tree. Previously a sliver was not visited if it was not visible or within the cache extent. `RenderViewportBase` also uses this in `describeSemanticsClip` and `describeApproximatePaintClip` to ensure a sliver child that wants to "ensure semantics" is not clipped out if it is not currently visible in the viewport or outside the cache extent. * `RenderSliverMultiBoxAdaptor.semanticBounds` now leverages its first child as an anchor for assistive technologies to be able to reach it if the Sliver is a child of `SliverEnsureSemantics`. If not it will still be dropped from the semantics tree. * `RenderProxySliver` now considers child overrides of `semanticBounds`. On the engine side we move from using a joystick method to scroll with `SemanticsAction.scrollUp` and `SemanticsAction.scrollDown` to using `SemanticsAction.scrollToOffset` completely letting the browser drive the scrolling with its current dom scroll position "scrollTop" or "scrollLeft". This is possible by calculating the total quantity of content under the scrollable and sizing the scroll element based on that. <details open><summary>Code sample</summary> ```dart // Copyright 2014 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; /// Flutter code sample for [SliverEnsureSemantics]. void main() => runApp(const SliverEnsureSemanticsExampleApp()); class SliverEnsureSemanticsExampleApp extends StatelessWidget { const SliverEnsureSemanticsExampleApp({super.key}); @OverRide Widget build(BuildContext context) { return const MaterialApp(home: SliverEnsureSemanticsExample()); } } class SliverEnsureSemanticsExample extends StatefulWidget { const SliverEnsureSemanticsExample({super.key}); @OverRide State<SliverEnsureSemanticsExample> createState() => _SliverEnsureSemanticsExampleState(); } class _SliverEnsureSemanticsExampleState extends State<SliverEnsureSemanticsExample> { @OverRide Widget build(BuildContext context) { final ThemeData theme = Theme.of(context); return Scaffold( appBar: AppBar( backgroundColor: theme.colorScheme.inversePrimary, title: const Text('SliverEnsureSemantics Demo'), ), body: Center( child: CustomScrollView( semanticChildCount: 106, slivers: <Widget>[ SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 0, child: Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Semantics( header: true, headingLevel: 3, child: Text( 'Steps to reproduce', style: theme.textTheme.headlineSmall, ), ), const Text('Issue description'), Semantics( header: true, headingLevel: 3, child: Text( 'Expected Results', style: theme.textTheme.headlineSmall, ), ), Semantics( header: true, headingLevel: 3, child: Text( 'Actual Results', style: theme.textTheme.headlineSmall, ), ), Semantics( header: true, headingLevel: 3, child: Text( 'Code Sample', style: theme.textTheme.headlineSmall, ), ), Semantics( header: true, headingLevel: 3, child: Text( 'Screenshots', style: theme.textTheme.headlineSmall, ), ), Semantics( header: true, headingLevel: 3, child: Text( 'Logs', style: theme.textTheme.headlineSmall, ), ), ], ), ), ), ), ), ), SliverFixedExtentList( itemExtent: 44.0, delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { return Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Text('Item $index'), ), ); }, childCount: 50, semanticIndexOffset: 1, ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 51, child: Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Semantics( header: true, child: const Text('Footer 1'), ), ), ), ), ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 52, child: Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Semantics( header: true, child: const Text('Footer 2'), ), ), ), ), ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 53, child: Semantics(link: true, child: const Text('Link #1')), ), ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 54, child: OverflowBar( children: <Widget>[ TextButton( onPressed: () {}, child: const Text('Button 1'), ), TextButton( onPressed: () {}, child: const Text('Button 2'), ), ], ), ), ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 55, child: Semantics(link: true, child: const Text('Link flutter#2')), ), ), ), SliverEnsureSemantics( sliver: SliverSemanticsList( sliver: SliverFixedExtentList( itemExtent: 44.0, delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { return Semantics( role: SemanticsRole.listItem, child: Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Text('Second List Item $index'), ), ), ); }, childCount: 50, semanticIndexOffset: 56, ), ), ), ), SliverEnsureSemantics( sliver: SliverToBoxAdapter( child: IndexedSemantics( index: 107, child: Semantics(link: true, child: const Text('Link flutter#3')), ), ), ), ], ), ), ); } } // A sliver that assigns the role of SemanticsRole.list to its sliver child. class SliverSemanticsList extends SingleChildRenderObjectWidget { const SliverSemanticsList({super.key, required Widget sliver}) : super(child: sliver); @OverRide RenderSliverSemanticsList createRenderObject(BuildContext context) => RenderSliverSemanticsList(); } class RenderSliverSemanticsList extends RenderProxySliver { @OverRide void describeSemanticsConfiguration(SemanticsConfiguration config) { super.describeSemanticsConfiguration(config); config.role = SemanticsRole.list; } } ``` </details> Fixes: flutter#160217 ## 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. <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
LongCatIsLooong
pushed a commit
that referenced
this pull request
Apr 30, 2025
Fixes error found in rolling to google.
```
[☠] Android toolchain - develop for Android devices (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message
below is not helpful, please let us know about this issue at
https://github.com/flutter/flutter/issues.
✗ type 'Null' is not a subtype of type 'String' of 'executable'
• #0 LocalProcessManager.canRun
(package:process/src/interface/local_process_manager.dart:124)
#1 getEmulatorVersion
(package:flutter_tools/src/android/android_workflow.dart:64)
flutter#2 AndroidValidator.validateImpl
(package:flutter_tools/src/android/android_workflow.dart:200)
flutter#3 DoctorValidator.validate
(package:flutter_tools/src/doctor_validator.dart:58)
flutter#4 Doctor.startValidatorTasks.<anonymous closure>
(package:flutter_tools/src/doctor.dart:244)
flutter#5 asyncGuard.<anonymous closure>
(package:flutter_tools/src/base/async_guard.dart:109)
flutter#6 _rootRun (dart:async/zone.dart:1525)
flutter#7 _CustomZone.run (dart:async/zone.dart:1422)
flutter#8 _runZoned (dart:async/zone.dart:2033)
flutter#9 runZonedGuarded (dart:async/zone.dart:2019)
flutter#10 runZoned (dart:async/zone.dart:1952)
flutter#11 asyncGuard (package:flutter_tools/src/base/async_guard.dart:106)
flutter#12 Doctor.startValidatorTasks
(package:flutter_tools/src/doctor.dart:234)
flutter#13 Doctor.diagnose (package:flutter_tools/src/doctor.dart:372)
flutter#14 DoctorCommand.runCommand
(package:flutter_tools/src/commands/doctor.dart:59)
flutter#15 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:1897)
<asynchronous suspension>
flutter#16 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1551)
<asynchronous suspension>
flutter#17 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154)
<asynchronous suspension>
flutter#18 CommandRunner.runCommand (package:args/command_runner.dart:212)
<asynchronous suspension>
flutter#19 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:501)
<asynchronous suspension>
flutter#20 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154)
<asynchronous suspension>
flutter#21 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:438)
<asynchronous suspension>
flutter#22 run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:98)
<asynchronous suspension>
flutter#23 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154)
<asynchronous suspension>
flutter#24 AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:154)
<asynchronous suspension>
flutter#25 run (package:mobile.flutter.cli/flutter_tools.dart:106)
<asynchronous suspension>
flutter#26 main (google3:///mobile/flutter/cli/bin/cli_usage_aot.dart:4)
```
## 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
LongCatIsLooong
pushed a commit
that referenced
this pull request
Aug 4, 2025
…er#172783)" (flutter#172900) <!-- start_original_pr_link --> Reverts: flutter#172783 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jtmcdole <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: Failing in post submit tests: ``` ╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════ ║ UNEXPECTED ERROR! ║ Exception: Found unexpected binary in cache: /Volumes/Work/s/w/ir/x/w/flutter/bin/cache/dart-sdk/bin/dartvm ║ #0 verifyExist (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/bots/suite_runners/run_verify_binaries_codesigned_tests.dart:198:9) ║ <asynchron <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: a-siva <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {jason-simmons} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: https://dart.googlesource.com/sdk.git/+log/5ede85aff798..14ea8d342149 https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-36.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-35.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-34.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-33.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-32.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-31.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-30.0.dev https://dart.googlesource.com/sdk.git/+/refs/tags/3.10.0-29.0.dev <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
LongCatIsLooong
added a commit
that referenced
this pull request
Oct 30, 2025
When building https://github.com/flutter/samples/tree/main/add_to_app/multiple_flutters, the `[CP-User] Run Flutter Build multiple_flutters_module Script` step failed with: ``` Showing Recent Messages [ +3 ms] Improperly formatted define flag: [ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:34:3) #1 AssembleCommand._parseDefines (package:flutter_tools/src/commands/assemble.dart:279:9) ``` the command was: ``` /Users/<User>/flutter/bin/flutter --verbose assemble --no-version-check --output=/Users/<User>/Library/Developer/Xcode/DerivedData/MultipleFluttersIos-<Hash>/Build/Products/Debug-iphonesimulator/ -dTargetPlatform=ios -dTargetFile=lib/main.dart -dBuildMode=debug -dConfiguration=Debug -dIosArchs=arm64 -dSdkRoot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.0.sdk -dSplitDebugInfo= -dTreeShakeIcons=false -dTrackWidgetCreation=true -dDartObfuscation=false -dAction=build -dFrontendServerStarterPath= --ExtraGenSnapshotOptions= --DartDefines= --ExtraFrontEndOptions= -dSrcRoot=/Users/<User>/flutter_debug/samples/add_to_app/multiple_flutters/multiple_flutters_ios -dTargetDeviceOSVersion=26.0 -dCodesignIdentity=- debug_ios_bundle_flutter_assets ``` the empty `--DartDefines=` comes from https://github.com/flutter/flutter/blob/68cddc9bf5c449d5a55fe48ebb9b446ef76ae6b0/packages/flutter_tools/bin/xcode_backend.dart#L660 This PR makes `_parseDefines` ignore these empty dart defines. ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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
LongCatIsLooong
pushed a commit
that referenced
this pull request
Nov 13, 2025
This test passes when run locally as instructed in the README for the devicelab ``` ../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t android_verified_input_test ``` but fails on CI: https://ci.chromium.org/ui/p/flutter/builders/staging/Linux_pixel_7pro%20android_verified_input_test/106/overview ``` [2025-11-03 11:08:04.090018] [STDOUT] stdout: [ ] Original error: ext.flutter.driver: (-32000) Service connection disposed [2025-11-03 11:08:04.090156] [STDOUT] stdout: [ ] Original stack trace: [2025-11-03 11:08:04.090199] [STDOUT] stdout: [ ] #0 new _OutstandingRequest (package:vm_service/src/vm_service.dart:268:34) [2025-11-03 11:08:04.091572] [STDOUT] stdout: [ ] #1 VmService._call.<anonymous closure> (package:vm_service/src/vm_service.dart:1950:25) [2025-11-03 11:08:04.091647] [STDOUT] stdout: [ ] flutter#2 VmService._call (package:vm_service/src/vm_service.dart:1962:8) [2025-11-03 11:08:04.091674] [STDOUT] stdout: [ ] flutter#3 VmService.callServiceExtension (package:vm_service/src/vm_service.dart:1901:14) [2025-11-03 11:08:04.091693] [STDOUT] stdout: [ ] flutter#4 VMServiceFlutterDriver.sendCommand (package:flutter_driver/src/driver/vmservice_driver.dart:327:12) [2025-11-03 11:08:04.091713] [STDOUT] stdout: [ ] flutter#5 FlutterDriver.requestData (package:flutter_driver/src/driver/driver.dart:573:13) [2025-11-03 11:08:04.091733] [STDOUT] stdout: [ ] flutter#6 main.<anonymous closure> (file:///opt/s/w/ir/x/w/rc/tmpv6pcbna2/flutter%20sdk/dev/integration_tests/android_verified_input/test_driver/main_test.dart:28:57) [2025-11-03 11:08:04.091750] [STDOUT] stdout: [ ] <asynchronous suspension> [2025-11-03 11:08:04.091767] [STDOUT] stdout: [ ] flutter#7 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:242:9) [2025-11-03 11:08:04.091784] [STDOUT] stdout: [ ] <asynchronous suspension> [2025-11-03 11:08:04.092408] [STDOUT] stdout: [ ] flutter#8 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:240:7) [2025-11-03 11:08:04.092472] [STDOUT] stdout: [ ] <asynchronous suspension> [2025-11-03 11:08:04.092502] [STDOUT] stdout: [ ] flutter#9 Invoker._waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:282:9) ``` Try copying this configuration used by other tests as a speculative fix. I can't get this test to kick off in presubmit, so I suppose we will just try this. The test is marked bringup anyways so it won't block the tree if this doesn't help. ## 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]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- 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 --------- Co-authored-by: Gray Mackall <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WIP
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.