Kate Lovett
9d96df2364
Modernize framework lints ( #179089 )
...
WIP
Commits separated as follows:
- Update lints in analysis_options files
- Run `dart fix --apply`
- Clean up leftover analysis issues
- Run `dart format .` in the right places.
Local analysis and testing passes. Checking CI now.
Part of https://github.com/flutter/flutter/issues/178827
- Adoption of flutter_lints in examples/api coming in a separate change
(cc @loic-sharma)
## 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
2025-11-26 01:10:39 +00:00
Kate Lovett
a04fb324be
Bump Dart to 3.8 and reformat ( #171703 )
...
Bumps the Dart version to 3.8 across the repo (excluding
engine/src/flutter/third_party) and applies formatting updates from Dart
3.8.
## 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 `///`).
- [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
2025-07-07 17:58:32 +00:00
Michael Goderbauer
5491c8c146
Auto-format Framework ( #160545 )
...
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.
**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.
---------
Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06: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
Polina Cherkasova
baf739c8e6
Remove usage of testWidgetsWithLeakTracking. ( #140239 )
2023-12-15 14:13:31 -08:00
Kostia Sokolovskyi
a6aaad3487
GestureRecognizer should dispatch creation and disposal events. ( #138223 )
2023-11-10 13:14:14 -08:00
Polina Cherkasova
ad05949971
Fix flakiness: finalize dropped gestures in tests to release resources, and update doc-comment. ( #136136 )
2023-10-10 18:11:23 -07:00
Kostia Sokolovskyi
9dd3e1e6fc
Fix memory leak in _DarwinViewState. ( #134938 )
2023-09-18 11:39:01 -07:00
yaakovschectman
e6e44de33c
Add MacOS AppKitView class. ( #132583 )
...
Add derived classes from the Darwin platform view base classes for
MacOS. Functionality is largely the same as the `UiKitView`, but the two
are decoupled and and can further diverge in the future as needed. Some
unit tests remain skipped for now as the gesture recognizers for MacOS
are not yet implemented.
https://github.com/flutter/flutter/issues/128519
## 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].
- [ ] 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
---------
Co-authored-by: Chris Bracken <chris@bracken.jp>
2023-08-31 17:48:12 -04:00
Mouad Debbar
55fe41be59
[web] New HtmlElementView.fromTagName constructor ( #130513 )
...
This wraps up the platform view improvements discussed in https://github.com/flutter/flutter/issues/127030 .
- Splits `HtmlElementView` into 2 files that are conditionally imported.
- The non-web version can be instantiated but it throws if it ends up being built in a widget tree.
- Out-of-the-box view factories that create visible & invisible DOM elements given a `tagName` parameter.
- New `HtmlElementView.fromTagName()` constructor that uses the default factories to create DOM elements.
- Tests covering the new API.
Depends on https://github.com/flutter/engine/pull/43828
Fixes https://github.com/flutter/flutter/issues/127030
2023-08-07 23:45:19 +00:00
Mouad Debbar
fc8856eb80
[web] Don't crash on const HtmlElementView() ( #128965 )
...
Previously, when the code contained `const HtmlElementView()` it would break even if it's guarded by `if (kIsWeb)`.
This PR makes it such that `const HtmlElementView()` is allowed but it still throws if it gets inserted into the widget tree by mistake on non-web platforms.
One improvement we can make in the future is to have a conditional import:
- `_html_element_view_web.dart` that contains the real `HtmlElementView` that can only be instantiated on web.
- `_html_element_view_io.dart` that contains a stub with an unimplemented `build()` method.
Fixes https://github.com/flutter/flutter/issues/43532
2023-06-16 13:53:05 +00:00
hellohuanlin
d1b8527f6b
[platform_view]fix iOS platform view's focus node leakage ( #124066 )
...
[platform_view]fix iOS platform view's focus node leakage
2023-04-05 03:56:51 +00:00
pdblasi-google
7ba1d5ec1b
Updates flutter/test/widgets to no longer reference TestWindow ( #122354 )
...
Updates `flutter/test/widgets` to no longer reference `TestWindow`
2023-03-14 18:19:17 +00:00
Gabriel Terwesten
ec289f1eb4
Don't call PlatformViewCreatedCallbacks after AndroidViewController is disposed ( #116854 )
...
* Don't call `PlatformViewCreatedCallback`s after `AndroidViewController` is disposed
Before this change it was possible that, if a `AndroidViewController` was disposed before we got the notification that the platform view was created, `PlatformViewCreatedCallback`s where called even after calling `AndroidViewController.dispose`.
Also makes `_PlatformViewLinkState._onPlatformViewCreated` more carful to only call `setState` when mounted.
Closes #84628
Closes #96384
* Allow all widgets to remove listeners from controller
* Remove assert
* Add expectations to test
2023-02-08 18:51:50 +00:00
Greg Spencer
ae7b99efb5
Rename _*Marker classes to be _*Scope, for consistency ( #118070 )
...
* Rename _*Marker classes to be _*Scope, for consistency
* [EMPTY] Commit to refresh the tree that is currently red (#118062 )
* Fix remaining tests
Co-authored-by: Drew Roen <102626803+drewroengoogle@users.noreply.github.com>
2023-01-17 18:55:22 +00:00
Michael Goderbauer
b308555ed1
Enable dangling_library_doc_comments and library_annotations lints ( #117365 )
2022-12-20 16:03:21 -08:00
Michael Goderbauer
fa3777bd3e
Enable sized_box_shrink_expand lint ( #117371 )
...
* Enable lint
* note about discarded_futures
* note about use_decorated_box
* update note on require_trailing_commas
2022-12-20 19:07:15 +00:00
Michael Goderbauer
bf5fdb9f96
Reland "Inject current FlutterView into tree and make available via View.of(context) ( #116924 )" ( #117244 )
...
* Reland "Inject current `FlutterView` into tree and make available via `View.of(context)` (#116924 )"
This reverts commit 9102f2fe0bd26db6074ac4a17785296cd341ecb9.
* remove window placeholder
2022-12-17 06:14:19 +00:00
Casey Hillers
9102f2fe0b
Revert "Inject current FlutterView into tree and make available via View.of(context) ( #116924 )" ( #117214 )
...
This reverts commit a34e41948461de77bdec3dcc884900cd4544abb1.
2022-12-16 17:48:23 +00:00
Michael Goderbauer
a34e419484
Inject current FlutterView into tree and make available via View.of(context) ( #116924 )
...
* enable View.of
* tests
* ++
* greg review
* rewording
* hide view from public
2022-12-16 00:13:56 +00:00
Maurice Parrish
95ace11afa
Include initial offset when using PlatformViewSurface ( #114103 )
...
* add position to layout creation
* make position nullable
* fix tests
* test
* clear test size
* clear device pixel ratio
* add more documentaiton
* add comment about localToGlobal
2022-11-15 18:21:37 +00:00
stuartmorgan
5c381254e3
Wait for non-empty layout in platform view placeholder ( #112402 )
2022-10-05 12:58:20 +00:00
stuartmorgan
bc994c7ffd
Allow Hybrid Composition fallback for Android platform views ( #109161 )
2022-09-21 15:57:11 +00:00
stuartmorgan
ab23233fa8
Reland: Fix Android platform view creation flow ( #109405 )
2022-08-12 01:26:19 +00:00
Casey Hillers
9ad052a57e
Revert "Fix Android platform view creation flow" ( #109389 )
...
Merging on red to green the build.
2022-08-11 08:05:27 -07:00
stuartmorgan
a47b3ccc2c
Fix Android platform view creation flow ( #109232 )
2022-08-11 02:26:30 +00:00
hellohuanlin
0dd0c2edca
[platform_view]Send platform message when platform view is focused ( #105050 )
2022-06-23 00:01:07 +00:00
Alexandre Ardhuin
56c4e3cdd8
add some exports of public API in foundation/serialization.dart ( #104231 )
2022-06-08 13:33:12 -07:00
hellohuanlin
f85209272d
Add Focus support for iOS platform view ( #103019 )
2022-05-23 17:58:13 -07:00
Tong Mu
23bc3d64eb
[Mouse] Remove all pointers at the end of tests ( #102694 )
2022-05-19 17:48:10 -07:00
Emmanuel Garcia
012952ba47
Don't build surface until the platform view has been created ( #101399 )
2022-04-07 15:31:04 -07:00
Emmanuel Garcia
032205eaca
Reland: "Use texture layer when displaying an Android view" ( #100990 )
2022-03-29 19:40:17 -07:00
Zachary Anderson
37d619d228
Revert "Reland: "Use texture layer when displaying an Android view" ( #100934 )" ( #100950 )
...
This reverts commit 61c30eed4f19009aa3caf8eede877c40c105b1b9.
2022-03-29 08:27:55 -07:00
Emmanuel Garcia
61c30eed4f
Reland: "Use texture layer when displaying an Android view" ( #100934 )
2022-03-28 21:25:06 -07:00
Emmanuel Garcia
19680c34cc
Revert "Reland: "Always use texture layer when displaying an Android view" ( #100237 )" ( #100660 )
...
This reverts commit d92fedcccb645ba155e93c5b72052692f10196b1.
2022-03-24 00:28:13 -07:00
Emmanuel Garcia
d92fedcccb
Reland: "Always use texture layer when displaying an Android view" ( #100237 )
2022-03-17 12:46:26 -07:00
Zachary Anderson
1c2c942112
Revert "Always use texture layer when displaying an Android view ( #100091 )" ( #100222 )
...
This reverts commit 509ddfda5c1bda7c01cf51fe24607da19423d5f9.
2022-03-16 09:12:25 -07:00
Emmanuel Garcia
509ddfda5c
Always use texture layer when displaying an Android view ( #100091 )
2022-03-15 21:10:18 -07:00
Emmanuel Garcia
f58e8f56ef
Fix AndroidView offset and resize ( #99888 )
2022-03-14 14:39:32 -07:00
Ian Hickson
61a0add286
Enable avoid_redundant_argument_values lint ( #91409 ) ( #91462 )
2021-10-08 09:25:14 -07:00
Zachary Anderson
b9d2177da0
Revert "Enable avoid_redundant_argument_values lint ( #91409 )" ( #91461 )
...
This reverts commit 5fd259be244244e14ff87fee9b6a721625f952cd.
2021-10-07 21:11:07 -07:00
Ian Hickson
5fd259be24
Enable avoid_redundant_argument_values lint ( #91409 )
2021-10-07 20:13:02 -07:00
Alexander Dahlberg
6784ebc57b
Fixed leak and removed no-shuffle tag on test/widgets/platform_view_test.dart ( #88877 )
2021-08-30 17:41:06 -07:00
Greg Spencer
738ce43d97
Randomize tests, exclude tests that fail with randomization. ( #86793 )
...
* Randomize tests, exclude tests that fail with randomization.
* Disable some more tool tests
2021-07-26 23:40:49 -07:00
Greg Spencer
6adea05276
Revert "Randomize Framework tests, opt out some tests that currently fail. ( #85159 )" ( #85673 )
...
This reverts commit b5f9612 because it is taking about 40% longer to run the tests, which is causing timeouts.
2021-06-30 19:38:09 -07:00
Greg Spencer
b5f9612cac
Randomize Framework tests, opt out some tests that currently fail. ( #85159 )
...
This turns on order shuffling for all tests that don't fail with it on, marking those tests that do fail with a tag so that they will be run without shuffling on.
To determine which tests fail with it on, I ran all the tests 100 times with different random shuffle seeds, and then also ran it with the date seeds from today until the end of July, and tagged all of the test suites (files) that fail, with a seed that caused them to fail.
2021-06-29 13:46:13 -07:00
Emmanuel Garcia
734df6f5c6
Allow Flutter focus to interop with Android view hierarchies ( #84055 )
2021-06-10 16:06:04 -07:00
Anis Alibegić
c99ed373b3
Fixed large amount of spelling errors ( #83744 )
2021-06-02 10:14:06 -07:00
Ian Hickson
5e0cc4cba4
Migrate to ChannelBuffers.push ( #82564 )
2021-05-21 15:09:03 -07:00
Ian Hickson
2ae1e39810
Revert "Migrate to ChannelBuffers.push ( #82057 )" ( #82525 )
2021-05-14 12:09:03 -07:00