deserializeFinder method Null safety

SerializableFinder deserializeFinder(
  1. Map<String, String> json
)

Deserializes the finder from JSON generated by SerializableFinder.serialize.

Implementation

SerializableFinder deserializeFinder(Map<String, String> json) {
  final String? finderType = json['finderType'];
  switch (finderType) {
    case 'ByType': return ByType.deserialize(json);
    case 'ByValueKey': return ByValueKey.deserialize(json);
    case 'ByTooltipMessage': return ByTooltipMessage.deserialize(json);
    case 'BySemanticsLabel': return BySemanticsLabel.deserialize(json);
    case 'ByText': return ByText.deserialize(json);
    case 'PageBack': return const PageBack();
    case 'Descendant': return Descendant.deserialize(json, this);
    case 'Ancestor': return Ancestor.deserialize(json, this);
  }
  throw DriverError('Unsupported search specification type $finderType');
}