toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      'id': id,
      'tool': tool.name,
      'points': points.map((p) => p.toJson()).toList(),
      'color': color.toARGB32(),
      'strokeWidth': strokeWidth,
      'isLocked': isLocked,
      'isSelected': isSelected,
      'properties': properties,
      if (label.isNotEmpty) 'label': label,
    };