fromJson static method

BoolDataType fromJson(
  1. Map<String, dynamic> data
)
override

Factory method: parse a JSON representation into a concrete DataType. Looks up the correct subclass in _dataTypes.

Implementation

static BoolDataType fromJson(Map<String, dynamic> data) {
  if (data['type'] != 'bool') {
    throw Exception("Expected type 'bool', got '${data['type']}'");
  }
  return BoolDataType(nullable: data["nullable"], metadata: data["metadata"]);
}