fromJson static method

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

Implementation

static RayTool fromJson(Map<String, dynamic> json) {
  return RayTool(
    id: json['id'],
    startPoint: json['startPoint'] != null
        ? Offset(json['startPoint']['x'], json['startPoint']['y'])
        : null,
    directionPoint: json['directionPoint'] != null
        ? Offset(json['directionPoint']['x'], json['directionPoint']['y'])
        : null,
    color: Color(json['color']),
    strokeWidth: json['strokeWidth'],
  );
}