Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operators.dart error "NoSuchMethodError: The method 'call' was called on null." #3

Open
TonyLovesDevOps opened this issue Dec 11, 2022 · 0 comments

Comments

@TonyLovesDevOps
Copy link

This code fails when run in VScode as well as with the official Dart 2.14 and 2.18 docker images (the only ones I tried).

Specifically, this block throws the error:

  var paint = Paint() // Throws "NoSuchMethodError: The method 'call' was called on null."
    ..color = 'black'
    ..strokeCap = 'round'
    ..strokeWidth = 5.0;

Repro with official dart docker image:

docker run -i dart:2.14 bash -c 'curl -fsLO https://raw.githubusercontent.com/fireship-io/dart-course/main/bin/operators.dart && dart operators.dart'
Unhandled exception:
NoSuchMethodError: The method 'call' was called on null.
Receiver: null
Tried calling: call()
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:63:5)
#1      main (file:///root/operators.dart:32:20)
#2      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:283:19)
#3      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant