nil method

void nil()
inherited

updates the value to null and adds it to the Stream. Even with null-safety coming, is still an important feature to support, as call() doesn't accept null values. For instance, InputDecoration.errorText has to be null to not show the "error state".

Sample:

final inputError = ''.obs..nil();
print('${inputError.runtimeType}: $inputError'); // outputs > RxString: null

Implementation

void nil() {
  subject.add(_value = null);
}