With the assumption that IDEs will not create a debug session for the
widget previewer, the widget inspector's source navigation functionality
won't function as there's no IDE to listen to `navigate` events sent via
`postEvent`.
This change overrides some widget inspector behavior to allow for
navigating to source locations via the DTD Editor service instead of
relying on the VM service's `postEvent`.
This change also makes some minor changes to the diagnostic properties
and descriptions displayed within the inspector to display group and
custom preview annotation details.
Towards https://github.com/flutter/flutter/issues/166423
**What/Why**
On Flutter Web with semantics enabled, <input type="email"> can reject
selection APIs in some browsers, causing:
cursor to not advance while typing,
selection to fail (and selected text not deletable),
and, in some cases, InvalidStateError exceptions.
This PR updates the semantics editing element for email fields to keep
selection/cursor APIs working while preserving email UX.
**How**
In
engine/src/flutter/lib/web_ui/lib/src/engine/semantics/text_field.dart:
Use type="text" for SemanticsInputType.email
Add inputmode="email" (keeps email keyboard layout/hints)
Add autocomplete="email" (preserves autofill)
Add autocapitalize="none" (prevents unwanted capitalization)
Remove the attributes when not email
Rationale: type="text" avoids browser selection restrictions;
inputmode="email" preserves the expected email keyboard; autofill and
capitalization behavior is retained/optimized.
**Before/After**
Before the change
https://email-0923-before.web.app/
After the change
https://email-0923.web.app/
**Impact**
Cursor now advances correctly while typing in email fields under
semantics.
Text can be selected and deleted normally.
Avoids InvalidStateError crashes with accessibility semantics enabled.
**Tests/Verification**
Manually verified on Chrome and safari:
Typing in email fields advances cursor correctly
Drag-select, double-click select, and Cmd/Ctrl+A work
Deleting selected text works
No exceptions thrown with semantics enabled
Autofill prompts continue to appear when saved emails are available.
Mobile keyboards (iOS/Android) show email-optimized layout via
inputmode="email".
**Fixed issues**
Fixesflutter/flutter#173239
## 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.
## What's new?
- 🍏 Added the concept of dialogs to the windowing API. New
symbols:
- `DialogWindowControllerDelegate`
- `DialogWindowController`
- `WindowingOwner.createDialogWindowController`
- `DialogWindow`
- `WindowControllerCommon`
- 🥘 Introduced the `WindowControllerCommon` mixin to
share common windowing functionality between controller types
- I have NOT yet implemented dialogs. This pull request ONLY adds the
idea to the API. Win32 implementation to follow :)
## 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.
Related to #176027
Minimum agp version already requires Java 17 this aligns our tooling.
This pr needs to land after the following prs
1. https://github.com/flutter/flutter/pull/176203
2. https://github.com/flutter/flutter/pull/176204
3. https://github.com/flutter/flutter/pull/176097
## 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.
## What's new?
- Renamed `DisplayMonitor` to `DisplayManager` on win32
## 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.
Add support for LTO builds on Linux.
<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->
*Replace this paragraph with a description of what this PR is changing
or adding, and why. Consider including before/after screenshots.*
*List which issues are fixed by this PR. You must list at least one
issue. An issue is not required if the PR fixes something trivial like a
typo.*
*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*
## Pre-launch Checklist
- [v] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [v] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [v] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [v] I signed the [CLA].
- [v] I listed at least one issue that this PR fixes in the description
above.
- [v] I updated/added relevant documentation (doc comments with `///`).
- [v] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [v] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [v] 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
---
- Enable LTO on Linux.
- Build test
- I validated the build in the Yocto build system using meta-flutter
# Build before modification.
```bash
# clone poky
$ source oe-init-build-env
$ echo "MACHINE = \"genericarm64\"" >> build/conf/local.conf
# clone meta-flutter.
$ git clone https://github.com/meta-flutter/meta-flutter.git
# Added meta-oe and meta-flutter to BBLAYERS in build/conf/bblayers.conf
$ bitbake flutter-engine
# Check whether LTO has been applied in compile_commands.json
$ cat build/tmp/work/armv8a-poky-linux/flutter-engine/3.32.8/sources/gn/engine/src/out/linux_debug_arm64/compile_commands.json | grep "\-flto"
..nothing
```
# Build after modification.
```
# checkout modified meta-flutter a901568da3
$ cd meta-flutter
$ git remote add markyang92 https://github.com/markyang92/meta-flutter.git
$ git fetch markyang92 a901568da38de2ad3c8a176311b86d8e0f2bb1c1
$ git cherry-pick FETCH_HEAD
$ cd ..
$ bitbake flutter-engine
# Check whether LTO has been applied in compile_commands.json
$ cat build/tmp/work/armv8a-poky-linux/flutter-engine/3.32.8/sources/gn/engine/src/out/linux_debug_arm64/compile_commands.json | grep "\-flto"
"command": ".....clang++ ... Omitted .. \
-flto ..... \
-g0 -Wunreachable-code -fvisibility-inlines-hidden -std=c++17 -fno-rtti -nostdinc++ -nostdinc++ -fvisibility=hidden -fno-exceptions -c ../../flutter/fml/string_conversion.cc -o clang_x64/obj/flutter/fml/string_conversion.string_conversion.o"
```
Related to #176027
## 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.
- [ ] 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.
With modern pwsh.exe there seems to be a problem with call operator
making nested powershell script invocation. Use Invoke-Expression
instead.
Fixes https://github.com/flutter/flutter/issues/173554
This PR forwards scene lifecycle events from the SceneDelegate to
registered plugins.
This PR introduced 3 new public APIs:
* `FlutterSceneLifeCycleDelegate` (protocol) - This is the protocol that
plugins conform to
* `FlutterSceneLifeCycleProvider` (protocol) - This is the protocol that
a SceneDelegate can conform to instead of `FlutterSceneDelegate`
* `FlutterPluginSceneLifeCycleDelegate` (interface) - This is the class
object that a SceneDelegate using `FlutterSceneLifeCycleProvider` can
use to forward scene events to
The flow of events are as followed when SceneDelegate subclasses the
`FlutterSceneDelegate`:
* `FlutterSceneDelegate` receives `sceneDidBecomeActive` event from
UIKit
* `FlutterSceneDelegate` forwards `sceneDidBecomeActive` to
`FlutterPluginSceneLifeCycleDelegate`
* `FlutterPluginSceneLifeCycleDelegate` loops through each
`FlutterEngine` it has and forwards `sceneDidBecomeActive` to the
engine's `FlutterEnginePluginSceneLifeCycleDelegate`
* `FlutterEnginePluginSceneLifeCycleDelegate` loops through each plugin
that conforms to `FlutterSceneLifeCycleDelegate` it has and forwards
`sceneDidBecomeActive` to the plugin
* `FlutterPluginSceneLifeCycleDelegate` forwards `sceneDidBecomeActive`
to `FlutterPluginAppLifeCycleDelegate` using
`sceneDidBecomeActiveFallback`
* `FlutterPluginAppLifeCycleDelegate` loops through all plugins and
calls `applicationDidBecomeActive` if the plugin does not conform to
`FlutterSceneLifeCycleDelegate`
When using `FlutterSceneLifeCycleProvider` instead of
`FlutterSceneDelegate`, scene events are manually forwarded to
`FlutterPluginSceneLifeCycleDelegate` by the iOS developer. For example:
```swift
class SceneDelegate: UIResponder, UIWindowSceneDelegate, FlutterSceneLifeCycleProvider {
var sceneLifeCycleDelegate: FlutterPluginSceneLifeCycleDelegate = FlutterPluginSceneLifeCycleDelegate()
func sceneDidBecomeActive(_ scene: UIScene) {
sceneLifeCycleDelegate.sceneDidBecomeActive(scene)
}
```
Fixes https://github.com/flutter/flutter/issues/174398.
## 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
## 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.
- [x] All existing and new tests are passing.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This change adds support for two DTD Editor service RPCs and makes
functionality that's dependent on the availability of the Editor service
reactive to the service availability changing.
The newly added `getActiveLocation` Editor RPC now allows for us to
properly determine which source file is selected at startup, removing
the need for special casing around initializing the filtered preview
set.
The `navigateToCode` Editor RPC is now supported, and URIs in stack
traces can now be clicked to navigate to the source location in the IDE.
Both filtering previews by selected file and stack frame navigation
links are only enabled when the Editor service is available.
Fixes https://github.com/flutter/flutter/issues/176113
Taken partially from https://github.com/flutter/flutter/pull/170446 with
only the changes to add a ScaleTranslate rectangle transform method
brought over. Unlike the original PR, this PR will apply that optimized
method for any caller who transforms a rectangle rather than just the
matrix/clip tracker for the engine layer tree code.
A benchmark for the new methods is also provided to verify their
improved performance.
Closes https://github.com/flutter/flutter/issues/92040
- Adds `expanded` semantics flag support to Android
- Adds `onExpand` and `onCollapse` semantics actions
- Updates `robolectric` library
- Adds java and dart tests
#### Why were `onExpand` and `onCollapse` actions added?
It turned out that TalkBack doesn't announce the `expanded` state if
`expand/collapse` action is not set for the accessibility node.
#### Why was the `robolectric` library updated?
The `expanded` state support in Android was introduced in API 36. The
`roboelectric: 4.14.1` doesn't support API 36. To run tests for a newly
added functionality `roboelectric` library was updated to `4.16`, which
supports the latest Android version
(https://github.com/robolectric/robolectric/releases/tag/robolectric-4.16).
In case you think it would be better to update the `roboelectric` in a
separate PR, please let me know.
<br/>
<details>
<summary>Example Source Code</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const App());
}
class App extends StatefulWidget {
const App({super.key});
@override
State<App> createState() => _AppState();
}
class _AppState extends State<App> {
final _controller = ExpansibleController();
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 24,
children: [
Text('Expansible Example'),
ListenableBuilder(
listenable: _controller,
builder: (context, child) {
return Semantics(
expanded: _controller.isExpanded,
onExpand: () {
print(' \n onExpand \n ');
_controller.expand();
},
onCollapse: () {
print(' \n onCollapse \n ');
_controller.collapse();
},
child: child,
);
},
child: Expansible(
headerBuilder: (context, _) => ListTile(
tileColor: Colors.blue.shade100,
leading: Text(
'Expansible',
style: TextStyle(fontSize: 20),
),
trailing: Icon(
_controller.isExpanded
? Icons.arrow_upward
: Icons.arrow_downward,
semanticLabel: _controller.isExpanded
? 'Arrow Up icon'
: 'Arrow Down icon',
),
),
bodyBuilder: (context, _) {
return Container(
color: Colors.blue,
height: 200,
width: 200,
);
},
controller: _controller,
),
),
],
),
),
);
}
}
```
</details>
https://github.com/user-attachments/assets/256c4182-a1e3-44fc-b028-5e6c9ec05ad7
## 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.
<!-- 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: ash2moon <muhatashim@google.com>
Related to #175669 and #176027
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [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.
Related to #176027
Needs to land after https://github.com/flutter/flutter/pull/176094
- **Add java warn and error to android workflow**
## 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This pr assumes https://github.com/flutter/flutter/pull/176049 lands
first.
- **Update java version ranges with the top end limitation for java pre
17**
- **change default for unknown agp version to true for java support**
- **Add kotlin 2.2* support for analyze --suggestions**
-
Related to https://github.com/flutter/flutter/issues/175669 and
https://github.com/flutter/flutter/issues/176027
## 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.