Skip to content

ValueNotifier not disposed when dragging cupertino text field #135803

@derdilla

Description

@derdilla

Is there an existing issue for this?

Steps to reproduce

  1. remove notDisposedAllowList from the test Can double tap + drag to select word by word in test/cupertino/text_field_test.dart`.
  2. See test reporting one undisposed ValueNotifier<_OverlayEntryWidgetState?>

PR that adds leak tracking for said test: #135804

Expected results

The Cupertino text field should not leak.

Actual results

The test fails
notDisposed:
      total: 1
      objects:
          ValueNotifier<_OverlayEntryWidgetState?>:
               test: Can double tap + drag to select word by word
               identityHashCode: 823061609

Code sample

Other tests that would fail when converted with testWidgetsWithLeakTracking:

  • Can move cursor when dragging, when tap is on collapsed selection (iOS) - multiline
  • Can move cursor when dragging, when tap is on collapsed selection (iOS)
  • Can move cursor when dragging (Android)

This leads me to believe the issue is related to dragging on the text field.

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.14.0-14.0.pre.461, on Garuda Linux 6.5.4-zen2-1-zen, locale en_US.UTF-8)
    ! Flutter version 3.14.0-14.0.pre.461 on channel [user-branch] at /home/derdilla/Coding/Flutter/flutter/flutter/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Upstream repository https://github.com/NobodyForNothing/flutter is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to https://github.com/NobodyForNothing/flutter to dismiss this error.
    • Framework revision 2cc47574a9 (6 days ago), 2023-09-24 19:28:57 +0200
    • Engine revision e4bfdc1a67
    • Dart version 3.2.0 (build 3.2.0-190.0.dev)
    • DevTools version 2.28.0-dev.12
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc3)
    • Android SDK at /home/derdilla/Android/Sdk
    • Platform android-34, build-tools 34.0.0-rc3
    • ANDROID_HOME = /home/derdilla/Android/Sdk
    • Java binary at: /home/derdilla/bin/apps/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/chromium

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6
    • cmake version 3.27.6
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2023.1)
    • Android Studio at /home/derdilla/bin/apps/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] Android Studio (version 2022.3)
    • Android Studio at /home/derdilla/.local/share/JetBrains/Toolbox/apps/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at /home/derdilla/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
    • Flutter plugin version 75.1.4
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Garuda Linux 6.5.4-zen2-1-zen
    • Chrome (web)    • chrome • web-javascript • Chromium 117.0.5938.132 Arch Linux

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: leak trackingIssues and PRs related to memory leaks detected by leak_trackerr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions