boolFromJson static method

bool boolFromJson(
  1. dynamic value
)

Implementation

static bool boolFromJson(dynamic value) {
  if (value == null) {
    return false;
  }
  if (value is String) {
    return value.toLowerCase() == "true";
  } else if (value is bool) {
    return value;
  } else if (value is int) {
    return value > 0;
  }
  return false;
}