fromJson static method

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

Implementation

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