Skip to content

"Method call" does not work for Callable Objects / callable standard #7237

@danielgomezrico

Description

@danielgomezrico

Steps to Reproduce

  1. Create a class like:
class PrintLogUseCase {
    void call() => print("example"); // *******
}

class PrintLogUseCase2 {
    void call() => print("example");
}

class PrintLogUseCase3 {
    void call() => print("example");
}
  1. from main call this class like:
void main() {
    final printLog = PrintLogUseCase();
    printLog();

    final printLog2 = PrintLogUseCase2();
    printLog2();

    final printLog3 = PrintLogUseCase3();
    printLog3();
}
  1. Comand + click the line with ******* and it shows every line that tries to do this, even if it is not just for this class:
    image

    The screenshot is using my project results, and because I have some other classes that implement a method called call and it shows those.

What should happen?

It should only show where the PrintLocUseCase was called because calling printLog(); is the same as printLog.call();

This is useful when you use the callable standard

Version info

Doctor summary (to see all details, run flutter doctor -v):
^C^C[!] Flutter (Channel [user-branch], 3.16.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-MX)
    ! Flutter version 3.16.4 on channel [user-branch] at /Users/danielgomezrico/projects/dev/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 unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
⣷-> ~/projects/drivers_app  18:31:16 feat/clear-on-complete
$ f doctor -v
[!] Flutter (Channel [user-branch], 3.16.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-MX)
    ! Flutter version 3.16.4 on channel [user-branch] at /Users/danielgomezrico/projects/dev/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 unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 2e9cb0aa71 (2 months ago), 2023-12-11 14:35:13 -0700
    • Engine revision 54a7145303
    • Dart version 3.2.3
    • DevTools version 2.28.4
    • 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)
    • Android SDK at /Users/danielgomezrico/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/danielgomezrico/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2023.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 17.0.7+0-17.0.7b1000.6-10550314)

[✓] IntelliJ IDEA Community Edition (version 2023.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 78.1.1
    • Dart plugin version 233.13763.5

[✓] VS Code (version 1.86.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 (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 14.2.1 23C71 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 122.0.6261.57

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions