validate method

int validate({
  1. int value = 0,
})

Validate given int is not null and returns given value if null.

Implementation

int validate({int value = 0}) {
  return this ?? value;
}