Interaction.fromMap constructor

Interaction.fromMap(
  1. dynamic map
)

Creates a new Interaction instance from a map.

Implementation

factory Interaction.fromMap(dynamic map) {
  return Interaction(
    elementId: map['elementId'],
    interactedAt: map['interactedAt'] != null
        ? DateTime.fromMillisecondsSinceEpoch(map['interactedAt'] * 1000)
        : DateTime.now(),
  );
}