InteractionEvent.fromJson constructor
Create an interaction event from a JSON map
Implementation
factory InteractionEvent.fromJson(Map<String, dynamic> json) {
return InteractionEvent(
widgetId: json['widgetId'],
type: InteractionType.values.firstWhere(
(e) => e.toString().split('.').last == json['type'],
orElse: () => InteractionType.custom,
),
value: json['value'],
timestamp: DateTime.parse(json['timestamp']),
);
}