fromJson static method

ARKitMaterialProperty fromJson(
  1. Map<String, dynamic> json
)

Implementation

static ARKitMaterialProperty fromJson(Map<String, dynamic> json) {
  final type = json['type'].toString();
  switch (type) {
    case 'color':
      return ARKitMaterialColor.fromJson(json);
    case 'image':
      return ARKitMaterialImage.fromJson(json);
    case 'value':
      return ARKitMaterialValue.fromJson(json);
    case 'video':
      return ARKitMaterialVideo.fromJson(json);
  }
  throw Exception('Could not parse material: $json');
}