FhirBoolean constructor

FhirBoolean(
  1. dynamic inValue
)

Implementation

factory FhirBoolean(dynamic inValue) {
  if (inValue is bool) {
    return FhirBoolean._(inValue.toString(), inValue, true, true);
  } else if (inValue is String) {
    return <String>['true', 'false'].contains(inValue.toLowerCase())
        ? FhirBoolean._(inValue, inValue.toLowerCase() == 'true', true, false)
        : FhirBoolean._(inValue, null, false, false);
  } else {
    throw CannotBeConstructed<FhirBoolean>(
        'Boolean cannot be constructed from $inValue of type '
        "'${inValue.runtimeType}'.");
  }
}