evaluateValue method

bool evaluateValue(
  1. dynamic value
)

Implementation

bool evaluateValue(value) {
  if (value == null) return false;

  if (value is String) {
    return value.isNotEmpty;
  } else if (value is bool) {
    return value;
  } else if (value is num) {
    return value != 0;
  } else if (value is List) {
    return value.isNotEmpty;
  } else if (value is Map) {
    return value.isNotEmpty;
  } else {
    throw StateError("Can't evaluate value of type: ${value.runtimeType}");
  }
}