Here is my Dart program:
void main() {
bool? b;
if(b==true){
print('b is true');
}else if(b==false){
print('b is false');
}else if(b==null){
print('b is null');
}else{
print('nothing!');
}
}
it outputs this as expected:
b is null
but for line,
else if(b==null)
it's showing this warning:
The operand can't be null, so the condition is always 'true'.

but operand 'b' can be null in the program, as 'b' is nullable(bool?), so it shouldn't show the warning.
it's showing the warning in both IntelliJ IDEA and in https://dartpad.dev/
looks like a bug to me.
if i add little more code like this, the warning is goes away: