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
Greg Price
47dd7639d2
Let DrivenScrollActivity subclasses customize handling of overscroll ( #166731 )
...
This functionality is useful in a custom DrivenScrollActivity subclass,
just like it's useful in a BallisticScrollActivity subclass.
For example, if one calls `animateTo(0, …)` to scroll to the beginning
of a list, there will be no overscroll (provided the chosen curve
doesn't go beyond its endpoint). The same is true if one calls
`animateTo(position.maxScrollExtent, …)` to scroll to the end... as long
as the value of maxScrollExtent at the beginning remains accurate when
the scroll view reaches the end. If one wants to scroll to the end and
avoid overscroll even when that turns out to be closer than the initial
estimate found in maxScrollExtent, then that calls for customizing the
overscroll behavior of a DrivenScrollActivity.
Fortunately we don't need to invent any new API in order to do this:
BallisticScrollActivity already has an API for the exact same need. So
copy that API -- name, docs, and all -- to keep these two classes
aligned.
(It might also be useful to take much of what these have in common and
factor that out to a common subclass; but that'd be for another PR.)
## 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 `///`).
- [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-04-30 01:53:15 +00:00
Greg Price
c1f6ceb9bb
Add a DrivenScrollActivity.simulation constructor ( #166730 )
...
I'd like to have a scroll activity that drives the scroll view through a
particular animation -- just like a DrivenScrollActivity does -- but
where the animation doesn't have an end point or duration that's known
when the animation begins.
(Concretely, this is to implement a "scroll to the end of history"
button in the Zulip message list. The end point is maxScrollExtent...
except that maxScrollExtent while in the middle of history is only an
estimate, and will change as the list view scrolls through shorter and
longer messages.)
That means the animation is naturally described by a Simulation, but not
by the parameters accepted by the current DrivenScrollActivity
constructor, or by the animateTo method which wraps it.
I think this can be handled quite cleanly with an alternate constructor
on DrivenScrollActivity, one that accepts a Simulation instead of the
from/to/duration/curve parameters accepted by the default constructor.
The new constructor is very similar to the constructor of
BallisticScrollActivity.
Most of the changes here are in revising the docs of both
DrivenScrollActivity and BallisticScrollActivity. The docs had
characterized the difference between the two as about using a Simulation
vs. the from/to/duration/curve animation parameters, but I think that's
never been the most important difference between them: the key
difference is really the `goBallistic` calls in BallisticScrollActivity,
particularly in `applyNewDimensions`, and the implications those have
for how the simulation needs to relate to the scroll physics. So this
rewrites the docs to describe that.
2025-04-18 22:06:24 +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
8fee7cb832
Adjust ignores for 'dart format' ( #160382 )
...
When running `dart format` over these lines the `// ignore` ended up on
a line where it wasn't properly ignoring the lint. This adjusts the
placement of `// ignore`s so they will continue to ignore the right
thing even after the code is auto formatted.
I am hoping that if we do this now the large PR that formats the entire
repo will go in smoother without manual intervention.
2024-12-16 22:01:25 +00:00
Polina Cherkasova
baf739c8e6
Remove usage of testWidgetsWithLeakTracking. ( #140239 )
2023-12-15 14:13:31 -08:00
Kostia Sokolovskyi
6d4d012397
ScrollDragController should dispatch creation and disposal events. ( #138800 )
2023-12-07 13:05:18 -08:00
Kostia Sokolovskyi
4880aab113
ScrollActivity should dispatch creation and disposal events. ( #137961 )
2023-11-06 14:14:08 -08:00
Kostia Sokolovskyi
e6d160a5c7
Cover more test/widgets tests with leak tracking #7 ( #134943 )
2023-09-20 13:27:29 -07:00
Kate Lovett
5f2d730f1f
Revert Ballistic & Clamping simulation updates ( #111201 )
2022-09-08 17:43:54 +00:00
Kate Lovett
b6f7289b18
Update Ballistic animation & ClampingScrollSimulation ( #107735 )
2022-08-19 17:24:03 +00:00
Callum Moffat
09e400ead9
Don't disable pointer interaction during trackpad scroll ( #106890 )
2022-08-17 22:57:07 +00:00
Michael Goderbauer
51bcdb9407
super parameters for framework ( #100905 )
2022-04-13 22:38:40 -07:00
Ian Hickson
ab89ce285f
Clean up the bindings APIs. ( #89451 )
2022-02-03 14:55:15 -08:00
nt4f04uNd
3f812722fb
RangeMaintainingScrollPhysics remove overscroll maintaining when grow ( #90608 )
2021-11-10 18:06:31 -08: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
chunhtai
93a1484ae0
Add a hook for scroll position to notify scrolling context when dimen… ( #87076 )
2021-08-23 15:39:18 -07:00
Ren You
3dea9f0251
Revert "Clean up the bindings APIs ( #86438 )" ( #86484 )
...
This reverts commit d056500bfe6a712cdace450d06c4a8fb2290e63a.
2021-07-15 09:29:16 -07:00
Ian Hickson
d056500bfe
Clean up the bindings APIs ( #86438 )
2021-07-14 14:41:24 -07:00
Zachary Anderson
7f741e9181
Revert "Clean up the bindings APIs ( #86388 )" ( #86404 )
...
This reverts commit 31de052e3fddb4909ff88172a6937db7f3dc49db.
2021-07-13 21:32:29 -07:00
Ian Hickson
31de052e3f
Clean up the bindings APIs ( #86388 )
2021-07-13 18:31:11 -07:00
Ian Hickson
c800b9c3e4
Revert "Clean up the bindings APIs ( #83843 )" ( #86386 )
...
This reverts commit e2490f2906060d0aaecbbe34a9240ca3d54ef998.
2021-07-13 15:47:40 -07:00
Ian Hickson
e2490f2906
Clean up the bindings APIs ( #83843 )
2021-07-13 12:41:03 -07:00
Alexandre Ardhuin
157bc92d4a
end of sort_child_properties_last ( #82457 )
2021-05-13 13:39:04 -07:00
Michael Goderbauer
b8a2456737
Enable library_private_types_in_public_api lint ( #81578 )
2021-05-10 16:26:16 -07:00
Alexandre Ardhuin
1a3af88ced
add missing trailing commas ( #81362 )
2021-04-28 10:54:05 -07:00
Greg Spencer
c6ef4c75d9
Turn on sized_box_for_whitespace lint, fix instances. ( #77099 )
2021-03-03 17:29:02 -08:00
Michael Goderbauer
0f568298d8
enable use_key_in_widget_constructors lint ( #77032 )
2021-03-02 10:14:02 -08:00
Greg Spencer
3f56178df8
Convert some more widget tests to NNBD ( #68129 )
2020-10-15 11:26:11 -07:00
Hans Muller
fd93576856
Replaced obsolete use of FlatButton with TextButton in scroll_activity_test ( #66602 )
2020-09-25 07:32:17 -07:00
Ian Hickson
e10bdbbd9d
Fix RangeMaintainingScrollPhysics ( #65135 )
2020-09-07 11:40:03 -07:00
renyou
32ee00849c
Revert "Fix RangeMaintainingScrollPhysics" ( #63611 )
2020-08-13 14:46:04 -07:00
Ian Hickson
e3c7fb5bef
Fix RangeMaintainingScrollPhysics ( #63146 )
...
It now uses the scroll metrics as they stood at the end of the last frame.
It previously used a weird combination of the old extents and the newish position, which led to some weird effects when the position had been changed in expectation of a viewport or content dimension change.
2020-08-11 08:59:20 -07:00