Skip to content

Instantly share code, notes, and snippets.

@stillie
Last active August 11, 2022 08:10
Show Gist options
  • Save stillie/c655e00920d2078654a9277287e3e450 to your computer and use it in GitHub Desktop.
Save stillie/c655e00920d2078654a9277287e3e450 to your computer and use it in GitHub Desktop.
Null Safety Question
void main() {
String? a;
String b;
a = "a";
b = "b";
print(a.test2);
a = null;
print(a.test2);
print(b.test2);
}
extension Test on String?{
String get test2 => "$this test";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment