KeyPath.fromJson constructor

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

Implementation

factory KeyPath.fromJson(Map<String, dynamic> json) {
  return KeyPath(
    type: KeyPathType.fromJson(json['type'] as String),
    string: json.containsKey('string') ? json['string'] as String : null,
    array: json.containsKey('array')
        ? (json['array'] as List).map((e) => e as String).toList()
        : null,
  );
}