Skip to content

Conversation

@ksokolovskyi
Copy link
Contributor

Description

Tests

  • Updates widgets/text_selection_test.dart to use testWidgetsWithLeakTracking;
  • Updates widgets/text_selection_toolbar_layout_delegate_test.dart to use testWidgetsWithLeakTracking.

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].
  • All existing and new tests are passing.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Oct 21, 2023
@ksokolovskyi
Copy link
Contributor Author

cc @polina-c

@polina-c polina-c added the a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker label Oct 23, 2023
_selectionPainter.dispose();
_caretPainter.dispose();
_textPainter.dispose();
_internalShowCursor?.dispose();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is set showCursor(ValueNotifier<bool> value) {. It makes things little more complicated. Should the setter dispose previous value?
Instead of creating new member _internalShowCursor, should we create flag _disposeShowCursor and update it every time _showCursor is assigned?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polina-c, thanks for the review.
I see what you mean, but we need to care only about the first internal ValueNotifier, which gets created on RenderEditable creation if showCursor is not passed. All next showCursor ValueNotifiers will be set using a setter, and their disposal is not our responsibility.
Am I missing something?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, however, if setter is invoked, should we dispose the previous value right away and null out all references to it, without waiting for disposal of the entire class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polina-c great thought!
Will do it that way, thanks :)

@ksokolovskyi ksokolovskyi requested a review from polina-c October 25, 2023 16:50
ksokolovskyi and others added 20 commits October 26, 2023 16:14
…7385)

Relands flutter#136851, which was rolled back in flutter#137121

package:coverage has been rolled, so the breakages should be fixed.
Also, in this reland I've changed the `coverableLineCache` parameter to
be optional, which is safer.
Fixes flutter#136593

Caching of the base url was introduced in flutter#53666 but resources can contain multiple `index.html` files, and currently hash of the **latest** asset will be assigned to the base url, which is not necessarily the root index.html
…sions) (flutter#137570)

Manual roll requested by [email protected]

flutter/engine@84dcb4f...4f87c20

2023-10-30 [email protected] Roll Dart SDK from
5a666e8d8259 to 85e149f894df (6 revisions) (flutter/engine#47470)
2023-10-30 [email protected] [deps] Stop moving NDK folder inside
Android SDK (flutter/engine#47454)
2023-10-30 [email protected] Revert "[Impeller] remove image
upload workarounds." (flutter/engine#47402)
2023-10-30 [email protected] Roll Skia from 89250a0bd6bb to
817fca468240 (3 revisions) (flutter/engine#47465)
2023-10-30 [email protected] Roll Skia from 006424658682 to
89250a0bd6bb (3 revisions) (flutter/engine#47463)
2023-10-30 [email protected] Migrate inja, sqlite, libtess2 to
//flutter/third_party. (flutter/engine#47408)
2023-10-30 [email protected] Revert "Roll Dart SDK from
5a666e8d8259 to 38e8459ca2aa (4 revisions)" (flutter/engine#47459)
2023-10-30 [email protected] Roll Skia from 09818d8c9d3c to
006424658682 (1 revision) (flutter/engine#47458)
2023-10-30 [email protected] Roll Skia from 6e9cd1b79105 to
09818d8c9d3c (1 revision) (flutter/engine#47456)
2023-10-30 [email protected] Remove call to
SkTypeface::MakeDefault (flutter/engine#47344)
2023-10-30 [email protected] Roll Fuchsia Linux SDK from
LbIVijDVwcB56_wgv... to zf2xLsbeoVrbnEDiH... (flutter/engine#47452)
2023-10-30 [email protected] Roll Skia from c732ec7f5d74 to
6e9cd1b79105 (2 revisions) (flutter/engine#47451)
2023-10-30 [email protected] Roll Skia from e45946f89a8b to
c732ec7f5d74 (2 revisions) (flutter/engine#47448)
2023-10-30 [email protected] Roll Fuchsia Mac SDK from
OJfJYAvhpAkE-kvbY... to jCjz-imbNBDjiRVa1... (flutter/engine#47447)
2023-10-30 [email protected] Roll Skia from 7545d1468268 to
e45946f89a8b (1 revision) (flutter/engine#47446)
2023-10-29 [email protected] Roll Skia from e224e1dc5e2c to
7545d1468268 (1 revision) (flutter/engine#47444)
2023-10-29 [email protected] Roll Fuchsia Linux SDK from
v-9_Di17lm_C_mrpZ... to LbIVijDVwcB56_wgv... (flutter/engine#47443)
2023-10-29 [email protected] Roll Fuchsia Mac SDK from
s0pbwY5MGxyq0tNrT... to OJfJYAvhpAkE-kvbY... (flutter/engine#47439)
2023-10-29 [email protected] Roll Skia from d29cc3fe182f to
e224e1dc5e2c (1 revision) (flutter/engine#47438)
2023-10-29 [email protected] Roll Fuchsia Linux SDK from
nreLekedxzmcdb3ww... to v-9_Di17lm_C_mrpZ... (flutter/engine#47436)
2023-10-29 [email protected] Roll Fuchsia Mac SDK from
qiHQ7aarDQb_1Rq3G... to s0pbwY5MGxyq0tNrT... (flutter/engine#47431)
2023-10-28 [email protected] Roll Fuchsia Linux SDK from
ESkamdoXWIwkdWdP-... to nreLekedxzmcdb3ww... (flutter/engine#47429)
2023-10-28 [email protected] Roll Fuchsia Mac SDK from
9YSl2rN0sj5YpYNdQ... to qiHQ7aarDQb_1Rq3G... (flutter/engine#47428)
2023-10-28 [email protected] Roll Dart SDK from
5a666e8d8259 to 38e8459ca2aa (4 revisions) (flutter/engine#47426)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from ESkamdoXWIwk to zf2xLsbeoVrb
  fuchsia/sdk/core/mac-amd64 from 9YSl2rN0sj5Y to jCjz-imbNBDj

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the
revert to ensure that a human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#137582)

flutter/engine@4f87c20...64b0e07

2023-10-30 [email protected] Roll Fuchsia Mac SDK from jCjz-imbNBDjiRVa1... to sBjtpAHoetjF77qxg... (flutter/engine#47482)
2023-10-30 [email protected] Roll Dart SDK from 85e149f894df to c8f75afabaf1 (1 revision) (flutter/engine#47479)
2023-10-30 [email protected] Update package:equatable pin (flutter/engine#47475)
2023-10-30 [email protected] [Impeller] Switch from `glBlitFramebuffer` to implicit MSAA resolution. (flutter/engine#47282)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from jCjz-imbNBDj to sBjtpAHoetjF

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#137584)

flutter/engine@64b0e07...44309c9

2023-10-30 [email protected] Roll Fuchsia Linux SDK from zf2xLsbeoVrbnEDiH... to 0D7msIyC3p_BdEY03... (flutter/engine#47490)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from zf2xLsbeoVrb to 0D7msIyC3p_B

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#137610)

flutter/engine@b4de734...5ca5cbb

2023-10-31 [email protected] Roll Fuchsia Mac SDK from sBjtpAHoetjF77qxg... to rg_Ici1tgAVF93cn9... (flutter/engine#47502)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from sBjtpAHoetjF to rg_Ici1tgAVF

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#137612)

flutter/engine@5ca5cbb...11a569d

2023-10-31 [email protected] Roll Fuchsia Linux SDK from 0D7msIyC3p_BdEY03... to LCfhx_lTRJI51G0zc... (flutter/engine#47503)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from 0D7msIyC3p_B to LCfhx_lTRJI5

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Badly formatted code causes distraction when reading, and costs people energy when understanding code.
If the benchmark runs out of time before it closes the drawer it is animating, it tries to divide by zero when computing the time per frame.

Don't report time per frame for activities with zero frames. This likely only happens for the close frame action, but guards are added to all time per frame computations in this benchmark.
flutter/packages@2af6954...c9fec61

2023-10-31 [email protected] [image_picker] Prevent multiple active calls on iOS (flutter/packages#5272)
2023-10-30 [email protected] [in_app_purchase_android] Add missing response code to BillingResponse enum (flutter/packages#5120)
2023-10-30 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.4 to 2.22.5 (flutter/packages#5263)
2023-10-30 [email protected] Bump play-service-maps dependency from version 18.1.0 to 18.2.0 (flutter/packages#5243)
2023-10-30 [email protected] Roll Flutter from a4ec627 to e12d1a7 (3 revisions) (flutter/packages#5267)
2023-10-30 [email protected] [camerax] Loosen restrictions of fallback strategies for choosing resolutions (flutter/packages#5239)
2023-10-30 [email protected] [pigeon] Don't wrap non-nullable primitives in Obj-C (flutter/packages#5214)
2023-10-30 [email protected] [flutter_lints] Replace "flutter pub add --dev" with "dev:" (flutter/packages#5260)
2023-10-28 [email protected] Roll Flutter from 5907c97 to a4ec627 (18 revisions) (flutter/packages#5255)
2023-10-27 [email protected] [go_router] Fixes deep-link with no path on cold start (flutter/packages#5113)
2023-10-27 [email protected] [two_dimensional_scrollables] Fix pinned row painting when one axis is reversed (flutter/packages#5187)
2023-10-27 [email protected] Roll Flutter from c555599 to 5907c97 (45 revisions) (flutter/packages#5252)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
## Description

This PR fixes typos in 
- `date_picker.dart`
- `date_picker_theme.dart`
- `dropdown.dart`
…rastLight`, & `ColorScheme.highContrastDark` constructors docs for Material 3 (flutter#137149)

fixes [Clarify ColorScheme fromSwatch/fromSeed usage](flutter#132584)

"This explains how to use `ColorScheme.fromSeed` as a substitute for each `ColorScheme` constructor."

| `ColorScheme.light` (left) to `ColorScheme.fromSeed` (right) | 
| --------------- | 
| ![light](https://github.com/flutter/flutter/assets/48603081/e056e723-5640-4b05-8feb-ca6b517c8682)	|

| `ColorScheme.dark` (left) to `ColorScheme.fromSeed` (right) | 
| --------------- | 
| ![dark](https://github.com/flutter/flutter/assets/48603081/5ff32611-bfb6-49ee-a34e-f935f580e84e)	|

| `ColorScheme.highContrastLight` (left) to `ColorScheme.fromSeed` (right) | 
| --------------- | 
| ![highContrastLight](https://github.com/flutter/flutter/assets/48603081/4b47f2e3-ea8e-4148-85cc-69690e9082c7) |

| `ColorScheme.highContrastDark` (left) to `ColorScheme.fromSeed` (right) | 
| --------------- | 
| ![highContrastDark](https://github.com/flutter/flutter/assets/48603081/3dbd7ec4-c78e-4228-a8ed-673832681563) |
…lutter#137635)

flutter/engine@4da3e5b...39be0fc

2023-10-31 [email protected] [Impeller] OpenGLES MSAA Render Buffers (i.e. for stencils) (flutter/engine#47495)
2023-10-31 [email protected] [Impeller] Migrate unit tests to named Rect factories (flutter/engine#47430)
2023-10-31 [email protected] [Typo fixed] in DEPS (flutter/engine#47440)
2023-10-31 [email protected] [Impeller] Restore GLES GPU query times. (flutter/engine#47511)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
_showHideCursor();
_showCursor.addListener(_showHideCursor);
}
_internalShowCursor?.dispose();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only goal of this field is to dispose cursor.
So, the name _internalShowCursor does not describe the meaning.
Also, as it is separate from _showCursor it is not very clear when the field should be disposed.

So, I still suggest to have a flag like _disposeShowCursor, and then it is clear that current value of _showCursor should be disposed if it is not needed any more.

How does it sound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polina-c, thanks for the review!
I totally agree with you, _disposeShowCursor is self-explanatory.

@ksokolovskyi ksokolovskyi requested a review from polina-c November 3, 2023 17:31
@polina-c polina-c merged commit 2d9a075 into flutter:master Nov 6, 2023
@ksokolovskyi
Copy link
Contributor Author

@polina-c, thanks a lot for the review!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2023
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 7, 2023
flutter/flutter@f5a9835...5a6a322

2023-11-07 [email protected] Roll Packages from 49eac1f to be18d28 (3 revisions) (flutter/flutter#137999)
2023-11-07 [email protected] Roll Flutter Engine from b1f2581f05e3 to b91400976b4a (2 revisions) (flutter/flutter#138000)
2023-11-07 [email protected] Roll Flutter Engine from 633065f75b1c to b1f2581f05e3 (1 revision) (flutter/flutter#137997)
2023-11-07 [email protected] Roll Flutter Engine from 99149d59cb3d to 633065f75b1c (1 revision) (flutter/flutter#137996)
2023-11-07 [email protected] Roll Flutter Engine from 7f4d56a7f4f7 to 99149d59cb3d (1 revision) (flutter/flutter#137987)
2023-11-07 [email protected] Roll Flutter Engine from f9f822359f2b to 7f4d56a7f4f7 (1 revision) (flutter/flutter#137983)
2023-11-07 [email protected] Roll Flutter Engine from b1a5d772792f to f9f822359f2b (1 revision) (flutter/flutter#137980)
2023-11-07 [email protected] Roll Flutter Engine from 461d815b48a0 to b1a5d772792f (13 revisions) (flutter/flutter#137979)
2023-11-07 [email protected] Roll Flutter Engine from bdfa8aa8f81f to 461d815b48a0 (1 revision) (flutter/flutter#137944)
2023-11-06 [email protected] SemanticsHandle should dispatch creation and disposal events. (flutter/flutter#137960)
2023-11-06 [email protected] ScrollActivity should dispatch creation and disposal events. (flutter/flutter#137961)
2023-11-06 [email protected] Cover text_selection tests with leak tracking. (flutter/flutter#137009)
2023-11-06 [email protected] Roll pub packages (flutter/flutter#137862)
2023-11-06 [email protected] Migration for `HotEvent` for Flutter hot runner (flutter/flutter#137717)
2023-11-06 [email protected] [benchmarks] disable partial repaint for multiple backdrop blur iOS macrobenchmarks. (flutter/flutter#137902)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 16, 2024
@polina-c polina-c changed the title Cover text_selection tests with leak tracking. Cover text_selection tests with leak tracking. [prod-leak-fix] Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants