Skip to content

Depending on packages which use TextSelectionOverlay.fadeDuration results in build failure #100343

@koji-1009

Description

@koji-1009

Steps to Reproduce

If some app is depend on a library (ex. flutter_math_fork) that uses TextSelectionOverlay.fadeDuration, the app will not be build with flutter 2.12.0-4.1.pre or higher.

ref #98153


In the library flutter_math_fork, TextSelectionOverlay.fadeDuration is used in the following line.
https://github.com/simpleclub-extended/flutter_math_fork/blob/a6f0c766a660b38c767fb12486672165630a8a69/lib/src/widgets/selection/handle_overlay.dart#L60

So, applications using flutter_math_fork cannot upgrade flutter until flutter_math_fork is updated.
On the other hand, if another library updates flutter to use SelectionOverlay.fadeDuration, the developer will need to modify that library's version. flutter_math_fork seems to be a popular library, but perhaps other libraries will have this problem as well.
search result

Would it be possible to add the following deprecated const value?

class TextSelectionOverlay {

  /// Controls the fade-in and fade-out animations for the toolbar and handles.
  @Deprecated(
      'Use `SelectionOverlay.fadeDuration` instead. '
      'This value was deprecated in Flutter 2.12.0-4.1.pre'
  )
  static const Duration fadeDuration = SelectionOverlay.fadeDuration;
}

Expected results:

No build errors.

Actual results:

An error occurs during build.

../../../.pub-cache/hosted/pub.dartlang.org/flutter_math_fork-0.6.1/lib/src/widgets/selection/handle_overlay.dart:60:40:
Error: Member not found: 'fadeDuration'.
        duration: TextSelectionOverlay.fadeDuration, vsync: this);
Code sample
Logs
../../../.pub-cache/hosted/[pub.dartlang.org/flutter_math_fork-0.6.1/lib/src/widgets/selection/handle_overlay.dart:60:40](http://pub.dartlang.org/flutter_math_fork-0.6.1/lib/src/widgets/selection/handle_overlay.dart:60:40):
Error: Member not found: 'fadeDuration'.
        duration: TextSelectionOverlay.fadeDuration, vsync: this);
$ flutter doctor -v
[✓] Flutter (Channel beta, 2.12.0-4.1.pre, on macOS 12.3 21E230 darwin-arm,
    locale ja-JP)
    • Flutter version 2.12.0-4.1.pre at /Users/koji/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 680962aa75 (30 hours ago), 2022-03-16 13:46:03 -0700
    • Engine revision e9f57b5d0f
    • Dart version 2.17.0 (build 2.17.0-182.1.beta)
    • DevTools version 2.11.1

[!] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/koji/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.11+0-b60-7772763)

[✓] IntelliJ IDEA Community Edition (version 2021.3.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 65.2.4
    • Dart plugin version 213.7227

[✓] VS Code (version 1.65.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 99.0.4844.74

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: buildBuilding flutter applications with the toola: typographyText rendering, possibly libtxtc: regressionIt was better in the past than it is nowfound in release: 2.12Found to occur in 2.12found in release: 2.13Found to occur in 2.13frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: 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