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
Nate
c53a18f4e4
Implementing null-aware operators throughout the repository ( #143804 )
...
This pull request fixes #143803 by taking advantage of Dart's null-aware operators.
And unlike `switch` expressions ([9 PRs](https://github.com/flutter/flutter/pull/143634 ) and counting), the Flutter codebase is already fantastic when it comes to null-aware coding. After refactoring the entire repo, all the changes involving `?.` and `??` can fit into a single pull request.
2024-02-23 19:02:22 +00:00
Todd Volkert
bc688cf0df
Make constraints a covariant argument in RenderBox.computeDryLayout() ( #136432 )
...
Some render box subclasses have a specific layout contract that is tightly coupled with other render box subclasses (e.g. two private classes in a local project file). In these cases, it is also possible that they use a constraints object that is a subclass of `BoxConstraints`. To allow for this, this change makes the `constraints` argument to `RenderBox.computeDryLayout()` a covariant argument.
For completeness' sake, this updates the other render objects in the rendering package to also use the covariant keyword for this argument.
2023-10-13 01:10:29 +00:00
Michael Goderbauer
b0a90aee17
Enable strict-inference ( #135043 )
...
Avoids that dynamic accidentally sneaks in, see https://dart.dev/tools/analysis#enabling-additional-type-checks
2023-09-20 19:59:08 +00:00
Kate Lovett
f054f5aa09
Move mock canvas to flutter_test ( #131631 )
...
Fixes https://github.com/flutter/flutter/issues/59413
This relocates `mock_canvas.dart` and `recording_canvas.dart` from `flutter/test/rendering` to `flutter_test`.
The testing functionality afforded by mock_canvas should be available to everyone, not just the framework. :)
mock_canvas.dart needed a bit of cleanup - things like formatting and super parameters.
2023-08-07 23:43:03 +00:00
Michael Goderbauer
5ab5d82a39
Remove AbstractNode from RenderObject and deprecate it ( #128973 )
...
It's time to say good bye to an old friend.
It has outlived its usefulness.
Farewell, AbstractNode! ð«¡
2023-06-16 16:16:36 +00:00
Michael Goderbauer
fda9ecfef7
Remove 1745 decorative breaks ( #123259 )
...
Remove 1745 decorative breaks
2023-03-22 21:12:22 +00:00
Greg Price
cd125e1f71
Add test for RenderProxyBoxMixin; clarify doc, resolve TODO ( #117664 )
...
* Add test for RenderProxyBoxMixin; clarify doc, resolve TODO
The TODO comment suggested this mixin would no longer be needed once
a Dart issue on inherited constructors was fixed:
https://github.com/dart-lang/sdk/issues/31543
That issue is now long since fixed, so I went to go carry out the TODO.
But in doing so, I realized that the mixin's documentation was more
right than the TODO comment: even with that issue fixed, there is a
legitimate use case for this mixin, namely to reuse the implementation
of RenderProxyBox in a class that also inherits from some other base
class. Moreover, searching GitHub I found an example of a library
that makes real use of that capability.
So I think the right resolution is to accept that this separation
is useful and delete the TODO.
Then, add a test with an extremely simplified sketch of that
real-world example. In case someone in the future attempts to
simplify this mixin away, the test will point us at the use case
that would be broken by such a change.
Also remove the only in-tree use of the mixin, which was redundant;
and expand the mixin's documentation to advise about that case.
* Tweak formatting
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
* Cut comments
---------
Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-08 01:17:23 +00:00
Jonah Williams
7e1e840999
[framework] revert removal of opacity ( #111202 )
2022-09-08 18:33:23 +00:00
Greg Spencer
ee8488e871
Remove warnings when UnconstrainedBox and ConstraintsTransformBox are clipped ( #110393 )
2022-08-29 17:21:04 +00:00
Tomasz Gucio
16c25caa44
Add RenderRepaintBoundary.toImageSync() method ( #108280 )
2022-07-27 05:17:04 +00:00
Jonah Williams
d36ecec5b9
[framework] partial removal of forced compositing from opacity ( #106989 )
2022-07-02 16:49:06 +00:00
Jonah Williams
c12b0de004
remove opacity layer at fully opaque ( #106351 )
2022-06-21 11:05:24 -07:00
Bruno Leroux
58007fc64c
Fix debugPaintSize throws 'Null Check error' ( #106108 )
2022-06-17 06:16:06 +00:00
Alexandre Ardhuin
56c4e3cdd8
add some exports of public API in foundation/serialization.dart ( #104231 )
2022-06-08 13:33:12 -07:00
Zachary Anderson
ac7e29a40f
Revert "remove forced compositing from opacity" ( #105489 )
2022-06-07 00:43:05 -07:00
Jonah Williams
febc6a14f5
remove forced compositing from opacity ( #105334 )
2022-06-06 12:13:07 -07:00
Casey Hillers
da105b2b24
Revert "[framework] inline AbstractNode into RenderObject" ( #104257 )
2022-05-20 11:43:11 -07:00
Jonah Williams
24bd28f696
[framework] inline AbstractNode into RenderObject ( #103832 )
2022-05-19 14:28:09 -07:00
Dan Field
fe87538b76
Implement paintsChild on RenderObjects that skip painting on their children ( #103768 )
2022-05-16 11:29:07 -07:00
Dan Field
4f96419612
Make _RenderCustomClip respect clipBehavior ( #103748 )
2022-05-13 17:14:07 -07:00
Phil Quitslund
bca071815f
rename local functions with _s ( #102615 )
2022-04-27 09:14:57 -07:00
Jonah Williams
fba9214d11
[framework] remove usage and deprecate physical model layer ( #102274 )
2022-04-26 16:14:04 -07:00
Jonah Williams
0cb5772e73
[framework] allow other RenderObjects to behave like repaint boundaries ( #101952 )
2022-04-26 10:19:09 -07: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
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
Dan Field
528f77dc99
Opacity fix ( #90017 )
...
* Make sure Opacity widgets/layers do not drop the offset
2021-09-13 19:10:15 -07:00
Dan Field
9db9256b38
Revert "Make sure Opacity widgets/layers do not drop the offset ( #89264 )" ( #89999 )
...
This reverts commit 0d0f7a4fb065da5de8640f1d6757cd5b9bc5534b.
2021-09-13 13:15:19 -07:00
Dan Field
0d0f7a4fb0
Make sure Opacity widgets/layers do not drop the offset ( #89264 )
2021-09-12 21:17:23 -07:00
Darren Austin
225a43d941
Updated skipped tests for rendering directory. ( #87700 )
2021-08-05 11:32:48 -07:00
Ren You
9ecba20fbd
Revert "Always push layer for RenderAnimatedOpacityMixin ( #83145 )" ( #84187 )
...
This reverts commit 048baa75913ede225cf140b725dda87f9dc2bebd.
2021-06-08 08:46:25 -07:00
Michael Goderbauer
048baa7591
Always push layer for RenderAnimatedOpacityMixin ( #83145 )
2021-06-03 17:32:37 -07:00
Alexandre Ardhuin
59fc92168a
add missing trailing commas ( #81065 )
2021-04-23 22:47:40 +02:00
Ian Hickson
f3c25fa07a
Align more closely with package:test ( #77118 ) ( #78343 )
2021-03-16 13:58:02 -07:00
Zachary Anderson
e7e1a04aa3
Revert "Align more closely with package:test ( #77118 )" ( #78329 )
...
This reverts commit 0cbe597540f6b51ab7157ab8747906e9923b79e4.
2021-03-16 09:26:34 -07:00
Ian Hickson
0cbe597540
Align more closely with package:test ( #77118 )
2021-03-15 16:28:02 -07:00
Alexandre Ardhuin
d546e1d311
fix for upcoming lint use_named_constants ( #74788 )
2021-01-27 20:20:44 +01:00
Alexandre Ardhuin
4acc790252
enable lint cast_nullable_to_non_nullable ( #67629 )
2020-10-08 21:05:43 +02:00
Kate Lovett
019e90f7df
[NNBD] Migrates some rendering tests ( #67449 )
2020-10-07 16:27:06 -07:00
Ian Hickson
8a6a76a334
migrate rendering to nullsafety ( #64621 )
2020-08-27 16:38:10 -07:00
Tong Mu
fb0b982324
Change MouseTracker's interface for clarity. Simplify MouseRegion's implementation. ( #64119 )
...
* Redesigns the interface between MouseTracker and RendererBinding&RenderView.
* Simplifies the structure of RenderMouseRegion.
* Extracts the common utility code between mouse_tracker_test and mouse_tracker_cursor_test.
2020-08-19 18:51:56 -07:00
Tong Mu
da8695d389
Mouse events report correct local positions ( #61190 )
2020-07-13 13:26:03 -07:00
Kate Lovett
ea777fea1b
Skip Audit - Rendering Library ( #58640 )
2020-07-09 13:36:03 -07:00
liyuqian
42e02d60d3
Reland non-breaking "Add clipBehavior to widgets with clipRect #55977 " ( #59364 )
...
* Revert "Revert "Add clipBehavior to widgets with clipRect (#55977 )" (#58344 )"
This reverts commit 1d395c5e187370f2838bb043d3b438029b484bfc.
* Add missed Overflow
2020-06-17 10:57:40 -07:00
Alexandre Ardhuin
4d7525f05c
Opt out nnbd in packages/flutter ( #59186 )
...
* add language version 2.8 in packages/flutter
* enable non-nullable analyzer flag
2020-06-11 14:11:30 +02:00