Activity.from constructor

Activity.from({
  1. required dynamic payload,
})

Implementation

factory Activity.from({ required dynamic payload }) {
  return Activity(
    payload['name'],
    GamePresence.values.firstWhere((status) => status.value == payload['type']),
    payload['url'],
    DateTime.fromMillisecondsSinceEpoch(payload['created_at']),
    payload['timestamps'] != null ? Timestamp.from(payload: payload['timestamps']) : null,
    payload['application_id'],
    payload['details'],
    payload['state'],
    payload['flags']
  );
}