getBoolValOr method

bool? getBoolValOr(
  1. dynamic key
)

Implementation

bool? getBoolValOr(dynamic key) {
  if (this[key] == null) return null;
  if (this[key] is bool) return this[key];
  if (this[key] is num) return this[key] != 0;
  if (this[key] is String) return this[key].isNotEmpty;
  return true;
}