validate method
Validates the given boolean value.
If the value is not null, it returns the value itself.
If the value is null, it returns the provided value
.
Example:
bool? value = null;
print(value.validate(value: true)); // true
print(value.validate()); // false
Implementation
bool validate({bool value = false}) => this ?? value;