CommsDeliveryInfo.fromJson constructor

CommsDeliveryInfo.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CommsDeliveryInfo.fromJson(Map<String, dynamic> json) {
  return CommsDeliveryInfo(
    userId: json['user_id'] as int? ?? json['userId'] as int? ?? 0,
    deliveredAt: json['delivered_at'] != null
        ? DateTime.tryParse(json['delivered_at'] as String)
        : null,
  );
}