31 lines
758 B
Dart
31 lines
758 B
Dart
class Voicemail {
|
|
final String id;
|
|
final String phoneNumber;
|
|
final String? sender;
|
|
final DateTime timestamp;
|
|
final Duration duration;
|
|
final String? filePath;
|
|
final bool isRead;
|
|
|
|
Voicemail({
|
|
required this.id,
|
|
required this.phoneNumber,
|
|
this.sender,
|
|
required this.timestamp,
|
|
required this.duration,
|
|
this.filePath,
|
|
this.isRead = false,
|
|
});
|
|
|
|
factory Voicemail.fromMap(Map<String, dynamic> map) {
|
|
return Voicemail(
|
|
id: map['id'],
|
|
phoneNumber: map['phoneNumber'],
|
|
sender: map['sender'],
|
|
timestamp: DateTime.fromMillisecondsSinceEpoch(map['timestamp']),
|
|
duration: Duration(seconds: map['duration']),
|
|
filePath: map['filePath'],
|
|
isRead: map['isRead'] ?? false,
|
|
);
|
|
}
|
|
} |