CommsReadInfo.fromJson constructor

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

Implementation

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