nullOrDefault method

dynamic nullOrDefault (
  1. dynamic normalValue,
  2. dynamic defaultValue
)

Implementation

nullOrDefault(var normalValue, var defaultValue) {
  if (normalValue == null) {
    return defaultValue;
  }
  return normalValue;
}