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
9cab4ffee1
Use wildcards ( #161548 )
...
https://dart.dev/language/pattern-types#wildcard
2025-01-14 05:13:41 +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
LongCatIsLooong
9ff7238937
Add handler for SemanticsAction.scrollToOffset ( #159811 )
...
Also closes https://github.com/flutter/flutter/issues/159515
~Looking at the google testing failures~ cl/703169955
## Pre-launch Checklist
- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-12-09 21:47:34 +00:00
Polina Cherkasova
745d2b4d2a
Clean up leaky test. ( #151131 )
2024-07-09 15:54:17 -07:00
Tim Lehmann
f5b671aac7
Draggable feedback positioning ( #149040 )
...
Reopened after revert in #147658
Another test was added in the meantime to `draggable_test.dart` that
didn't call `gesture.up()`. I added this call to the test and now all
tests pass.
---
# Original Description (#145647 ):
We changed the coordinates used to position the `Draggable` feedback by
transforming them into the `Overlay`s coordinate space. This has no
influence on any untransformed `Overlay`, most Flutter apps should be
not affected.
This PR fixes the positioning of the feedback in transformed context
(see #145639 for before video):
https://github.com/flutter/flutter/assets/42270125/df34e198-0667-453d-a27a-a79b2e2825a1
- fixes #145639
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
---------
Co-authored-by: Jesper Bellenbaum <ayu4ger@gmail.com>
2024-06-28 11:14:20 -07:00
auto-submit[bot]
5a41e1edac
Reverts "Draggable feedback positioning ( #145647 )" ( #147658 )
...
Reverts: flutter/flutter#145647
Initiated by: jmagman
Reason for reverting: Failing draggable_test in post-submit.
Original PR Author: timcreatedit
Reviewed By: {justinmc, goderbauer}
This change reverts the following previous change:
We changed the coordinates used to position the `Draggable` feedback by transforming them into the `Overlay`s coordinate space. This has no influence on any untransformed `Overlay`, most Flutter apps should be not affected.
This PR fixes the positioning of the feedback in transformed context (see #145639 for before video):
https://github.com/flutter/flutter/assets/42270125/df34e198-0667-453d-a27a-a79b2e2825a1
- fixes #145639
2024-05-01 18:26:27 +00:00
Tim Lehmann
5f9e069111
Draggable feedback positioning ( #145647 )
...
Fixes a calculation in Draggable that was previously wrong when the target was transformed.
2024-05-01 09:56:23 -07:00
Amir Panahandeh
c98d68de42
Add hitTestBehavior and rootOverlay to LongPressDraggable constructor… ( #146386 )
...
Passes through these two Draggable parameters so that they're usable in LongPressDraggable.
2024-04-15 12:20:11 -07:00
Polina Cherkasova
c4a7cf202a
Update leak related TODOs. ( #146743 )
...
https://github.com/flutter/flutter/issues/146742
2024-04-15 11:46:32 -07:00
Polina Cherkasova
9fee27b244
Leak clean up. ( #144803 )
...
Fix some leaks and mark others.
[Known leaks](https://github.com/issues?q=is%3Aopen+is%3Aissue+label%3A%22a%3A+leak+tracking%22+-label%3A%22c%3A+new+feature%22+ )
2024-03-24 18:01:17 +00:00
Polina Cherkasova
6dff3da31c
Organize leak tracking TODOs. ( #142460 )
2024-01-29 21:21:34 -08:00
Jesús S Guerrero
b5262f0d80
Revert "[web] - Fix broken TextField in semantics mode when it's a sibling of Navigator" ( #142129 )
...
Reverts flutter/flutter#138446
b/322136071
2024-01-24 16:13:26 +00:00
Hassan Toor
59e892d391
[web] - Fix broken TextField in semantics mode when it's a sibling of Navigator ( #138446 )
...
When a `TextField` is rendered before a `Navigator`, it breaks in semantics mode. This is because the framework generates the incorrect semantics tree (excludes the TextField) and when that tree gets sent to the engine, we don't get the signal to create the corresponding `<input>` element.
This happens for a few reasons:
* `ModalBarrier` uses `BlockSemantics` to drop the semantics of routes beneath the current route in `Navigator`
* `ModalBarrier` mistakenly recognizes the widget outside of the `Navigator` to be its sibling
* So we end up dropping the semantics node of the `TextField` rendered before it.
The fix is to let `Navigator` generate a semantics node so that `ModalBarrier` doesn't mistakenly think widgets outside of `Navigator` are its siblings.
`Navigator` doesn't currently do this, which causes all the nodes generated from its widget subtree to be directly attached to the parent semantics node above `Navigator` - since this is also the parent of `TextField`, it considers them siblings.
Fixes https://github.com/flutter/flutter/issues/129324
2024-01-22 17:03:14 +00:00
Polina Cherkasova
0f2618ff4f
Fix or except leaks. ( #141081 )
...
Contributes to https://github.com/flutter/devtools/issues/6909 .
2024-01-10 00:17:33 +00:00
Polina Cherkasova
baf739c8e6
Remove usage of testWidgetsWithLeakTracking. ( #140239 )
2023-12-15 14:13:31 -08:00
Valentin Vignal
f15f2313b9
Fixes DragTarget crash if Draggable.data is null ( #133136 )
...
Makes the `data` parameter of `Draggable` non-nullable.
Fixes https://github.com/flutter/flutter/issues/84816
*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2023-11-02 17:59:16 +00: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
7d0c9b7211
Cover more test/widgets tests with leak tracking ( #134387 )
2023-09-12 17:43:34 -07:00
Chinmoy
347f7bac94
Adds callback onWillAcceptWithDetails in DragTarget. ( #131545 )
...
This PR adds onWillAcceptWithDetails callback to DragTarget to get information about offset.
Fixes : #131378
This PR is subject to changes based on #131542
2023-08-25 21:24:05 +00:00
Michael Goderbauer
b0f1714b7b
Make Flex,Row,Column const for real ( #119673 )
...
* Make Flex,Row,Column const for real
* dart fix --apply
* fix snippets
* fix integration test
* add comment
2023-02-02 19:33:57 +00:00
Bernardo Ferrari
0752af841e
Add allowedButtonsFilter to prevent Draggable from appearing with secondary click. ( #111852 )
...
* DragTarget part 1.
[WIP] Change GestureRecognizer. Sorry.
[WIP] Move from GestureRecognizer to MultiDragGestureRecognizer.
Make it a `Set<int>?`
Get bitwise operations working.
Fix test. Rename to allowedInputPointers.
Convert into a builder.
Improve code with default funciton.
Refactor everything again.
Rename to buttonEventFilter.
Use static function.
Fix analyzer.
Fix private reference.
Use // in private method.
* Fix Renzo request.
* Add `allowedButtonsFilter` everywhere.
* Refactor monoDrag for multi pointer support.
* Fix tests?
* Change default to always true.
* Fix PR comments.
* Completely refactor long press.
* Add forgotten class.
* Revert "Completely refactor long press."
This reverts commit 5038e8603e250e8c928b0f1754fb794b7b75738b.
* Add default value to LongPress
* Refactor doubleTap.
* Relax double tap.
* Write comment in LongPress.
* Use template.
2023-01-13 05:45:49 +00:00
Michael Goderbauer
b308555ed1
Enable dangling_library_doc_comments and library_annotations lints ( #117365 )
2022-12-20 16:03:21 -08:00
Kate Lovett
75d8fb364c
Remove deprecated drag anchor ( #111713 )
2022-09-19 18:52:01 +00:00
Pierre-Louis
2aa348b940
Use curly_braces_in_flow_control_structures for widgets ( #104609 )
...
* Use `curly_braces_in_flow_control_structures` for `widgets`
* fix comments
* fix comments
2022-05-26 09:48:09 +02:00
Tong Mu
23bc3d64eb
[Mouse] Remove all pointers at the end of tests ( #102694 )
2022-05-19 17:48:10 -07:00
xubaolin
e5beafaf36
Expose ignoringPointer property for Draggable and LongPressDraggable ( #100475 )
2022-04-19 13:29:28 -05:00
Kate Lovett
f8eee10f96
Revert "Draggable can be accepted when the data is null" ( #99419 )
2022-03-02 10:31:11 -08:00
xubaolin
2ad0ac0ef2
Draggable can be accepted when the data is null ( #97355 )
2022-02-23 15:19:22 -08:00
Sam Rawlins
87f8873474
Add explicit null returns in flutter/test ( #94834 )
2021-12-14 10:14:06 -08:00
Ian Hickson
6d5fc420b6
Enable sort_child_properties_last lint ( #91585 )
2021-10-11 21:23:02 -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
Anis Alibegić
a753d09cc9
Fixed several typos ( #89485 )
2021-09-07 14:56:04 -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
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
Ian Hickson
b86d5c0094
Migrate to ChannelBuffers.push ( #82057 )
2021-05-13 14:34:04 -07:00
Abhishek Ghaskata
254c9f1755
Enable use_named_constants_lint ( #82426 )
2021-05-13 13:29:06 -07:00
Ren You
7f1d1414cc
Revert "Migrate to ChannelBuffers.push ( #81235 )" ( #81829 )
...
This reverts commit 35ad43f20caa71ec051a97bc8bc8fec552fb4452.
2021-05-04 06:17:19 -07:00
Ian Hickson
35ad43f20c
Migrate to ChannelBuffers.push ( #81235 )
2021-05-03 17:14:03 -07:00
Alexandre Ardhuin
1a3af88ced
add missing trailing commas ( #81362 )
2021-04-28 10:54:05 -07:00
Angjie Li
b74df388e1
Revert "Migrate to ChannelBuffers.push ( #76288 )" ( #81226 )
...
This reverts commit c26ed03c8a77810136cc087ae60048ace062842d.
2021-04-26 12:57:17 -07:00
Ian Hickson
c26ed03c8a
Migrate to ChannelBuffers.push ( #76288 )
...
* Migrate to ChannelBuffers.push
* Move TestDefaultBinaryMessenger to its own file
* Apply deprecations and fix usages
2021-04-23 15:39:34 -07:00
Phil Quitslund
61c30c41b2
fix sort_directives violations ( #80817 )
2021-04-21 13:49:03 -07:00
Ian Hickson
90c0e3e875
Clarify documentation for DragAnchorStrategy. ( #79160 )
2021-04-05 11:54:03 -07:00