COSELabel.fromJson constructor

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

Implementation

factory COSELabel.fromJson(Map<String, dynamic> json) {
  final type = COSELabelType.fromName(json.keys.firstOrNull);
  return switch (type) {
    COSELabelType.int => COSELabelInt.fromJson(json),
    COSELabelType.string => COSELabelString.fromJson(json)
  };
}