fromJsonMap<R> static method
Creates a CommentNode from a JSON map.
This factory method is used during workflow deserialization to recreate comment nodes from saved data.
Parameters:
json- The JSON map containing node datafromJsonT- Function to deserialize the custom data of typeR
Implementation
static CommentNode<R> fromJsonMap<R>(
Map<String, dynamic> json,
R Function(Object? json) fromJsonT,
) {
return CommentNode<R>(
id: json['id'] as String,
position: Offset(
(json['x'] as num).toDouble(),
(json['y'] as num).toDouble(),
),
text: json['text'] as String? ?? '',
data: fromJsonT(json['data']),
width: (json['width'] as num?)?.toDouble() ?? 200.0,
height: (json['height'] as num?)?.toDouble() ?? 100.0,
color: Color(json['color'] as int? ?? Colors.yellow.toARGB32()),
zIndex: json['zIndex'] as int? ?? 0,
isVisible: json['isVisible'] as bool? ?? true,
locked: json['locked'] as bool? ?? false,
);
}