fromJson method
Implementation
@override
Offset fromJson(Object? json) {
if (json is Map<String, dynamic>) {
final x = json['x'];
final y = json['y'];
return Offset(
x is num ? x.toDouble() : 0.0,
y is num ? y.toDouble() : 0.0,
);
}
return Offset.zero;
}