optNullableBoolean method

bool? optNullableBoolean(
  1. String name, {
  2. bool remove = false,
})

Returns the value mapped by name if it exists, coercing it if necessary, or null if no such mapping exists. If remove is true, then the mapping will be removed from the Map.

Implementation

bool? optNullableBoolean(String name, {bool remove = false}) {
  if (this?.containsKey(name) == false) {
    return null;
  }
  bool boolean = optBoolean(name);
  if (remove) {
    this?.remove(name);
  }
  return boolean;
}