getx
getx copied to clipboard
'isBlank' method doesn't check for null
Tried to use 'isNullOrBlank', but it says it's deprecated in favour of 'isBlank'. But according to the code seems the latter does not do it's job, correct me, if I'm wrong.
Screenshots
Flutter Version: Stable channel, 1.22.5
Getx Version: 3.24.0
This had to be done, because GetX is being prepared to be NullSafety
We need to deprecate this for the null-safety update, but I already found a loophole to make this possible again. I need to make sure that this will not be changed in the future, so I am waiting a while to make this possible again with GetX. However, I already notice that to check for null, you will need parentheses, example:
String? name;
void check() {
final isNull = (name).isNullOrBlank;
print(isNull); // out: true
}
final isNull = name.isNullOrBlank; WILL FAIL.
Any update?
@jonataslaw please bring this back, and pls update if you need help in upgrading this
final isNull = name.isNullOrBlank;
Would be
final isNull = name?.isNullOrBlank;