fromJson static method

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

Implementation

static SmsMessage fromJson(Map<String, dynamic> json) {
  return SmsMessage(
      id: json['id'],
      threadId: json['thread_id'],
      address: json['address'],
      body: json['body'],
      read: json['read'] != null ? (json['read'] == 1) : null,
      date: json['date'] != null
          ? DateTime.fromMillisecondsSinceEpoch(json['date'])
          : null,
      dateSent: json['date_sent'] != null
          ? DateTime.fromMillisecondsSinceEpoch(json['date_sent'])
          : null);
}