orDefault method

bool orDefault([
  1. bool defaultValue = false
])

Returns this value if non-null, otherwise defaultValue.

Example:

bool? value;
value.orDefault(); // false
value.orDefault(true); // true

Implementation

bool orDefault([bool defaultValue = false]) => this ?? defaultValue;