What is the recommended way to check for null with the new "sound null-safety" feature of Dart , specially for the compiler to stop complaining, this doesn't work:
I'm obviously checking that value.data isn't null before accessing it.
What is the recommended way to check for null with the new "sound null-safety" feature of Dart , specially for the compiler to stop complaining, this doesn't work:
I'm obviously checking that value.data isn't null before accessing it.
Only local variables will get promoted.
so if you say
final temp = value.data;
if(temp != null) {
profile.profilePic = temp.url;
}
it should work.