fromJson static method
Implementation
static Point? fromJson(Map<String, dynamic>? json) {
String? cssSelector = json?.optNullableString("cssSelector");
int? textNodeIndex = json?.optPositiveInt("textNodeIndex");
if (cssSelector == null || textNodeIndex == null) {
return null;
}
return Point(
cssSelector: cssSelector,
textNodeIndex: textNodeIndex,
charOffset: json.optPositiveInt("charOffset")
// The model was using `offset` before, so we still parse it to ensure
// backward-compatibility for reading apps having persisted legacy Locator
// models.
??
json.optPositiveInt("offset"));
}