Last active
July 9, 2020 06:11
-
-
Save creativecreatorormaybenot/89a94765d6dba72ae652a5c911d4ccf6 to your computer and use it in GitHub Desktop.
error: An expression whose value can be 'null' must be null-checked before it can be dereferenced - line 9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo { | |
const Foo({required this.bar}); | |
final void Function()? bar; | |
void doSomething() { | |
if (bar != null) { | |
// Analyzer still complains that bar can be null. | |
bar(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment