Capabilities.fromJson constructor

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

Creates a Capabilities from JSON data.

Implementation

factory Capabilities.fromJson(Map<String, dynamic> json) {
  final tempAddJson = json['add'];
  final tempDropJson = json['drop'];

  final List<String>? tempAdd =
      tempAddJson != null ? List<String>.from(tempAddJson) : null;
  final List<String>? tempDrop =
      tempDropJson != null ? List<String>.from(tempDropJson) : null;

  return Capabilities(
    add: tempAdd,
    drop: tempDrop,
  );
}