class SmsMessage { final int? id; final String phoneNumber; final String? contactName; final String content; final String type; // 'received' | 'sent' final String smsDate; SmsMessage({ this.id, required this.phoneNumber, this.contactName, required this.content, required this.type, required this.smsDate, }); Map toJson() => { 'phone_number': phoneNumber, 'contact_name': contactName, 'content': content, 'type': type, 'sms_date': smsDate, }; factory SmsMessage.fromJson(Map json) => SmsMessage( id: json['id'], phoneNumber: json['phone_number'], contactName: json['contact_name'], content: json['content'], type: json['type'], smsDate: json['sms_date'], ); }