/opt/canhelp/apps/mobile/lib/models
NameSizeModeActions
app_notification.dart24230644editdlrm
availability.dart7590644editdlrm
category.dart12940644editdlrm
chat_room.dart57590644editdlrm
dashboard_data.dart40160644editdlrm
location.dart14310644editdlrm
offer.dart26480644editdlrm
portfolio_item.dart9470644editdlrm
price_list.dart39330644editdlrm
review.dart15750644editdlrm
specialist_card.dart52650644editdlrm
task.dart62600644editdlrm
user.dart64170644editdlrm
Edit: /opt/canhelp/apps/mobile/lib/models/app_notification.dart (2423B)
enum NotificationType { message, offerAccepted, offerDeclined, taskUpdated, newOffer, taskInvite, review, specialistCardSubmitted, specialistCardApproved, specialistCardRejected, referralReward, supportReply, system, } NotificationType _parseType(String? v) { switch (v) { case 'message': case 'new_message': return NotificationType.message; case 'offer_accepted': return NotificationType.offerAccepted; case 'offer_declined': return NotificationType.offerDeclined; case 'task_updated': case 'task_completed': case 'task_cancelled': return NotificationType.taskUpdated; case 'new_offer': return NotificationType.newOffer; case 'task_invite': return NotificationType.taskInvite; case 'review': case 'new_review': return NotificationType.review; case 'specialist_card_submitted': return NotificationType.specialistCardSubmitted; case 'specialist_card_approved': return NotificationType.specialistCardApproved; case 'specialist_card_rejected': return NotificationType.specialistCardRejected; case 'referral_reward': return NotificationType.referralReward; case 'support_ticket_reply': return NotificationType.supportReply; default: return NotificationType.system; } } class AppNotification { final String id; final NotificationType type; final String title; final String body; final bool read; final String? referenceId; final String? userId; final DateTime createdAt; AppNotification({ required this.id, required this.type, required this.title, required this.body, this.read = false, this.referenceId, this.userId, required this.createdAt, }); factory AppNotification.fromJson(Map json) => AppNotification( id: json['id'] as String, type: _parseType(json['type'] as String?), title: json['title'] as String? ?? '', body: json['body'] as String? ?? json['message'] as String? ?? '', read: json['isRead'] as bool? ?? json['read'] as bool? ?? false, referenceId: json['referenceId'] as String? ?? json['taskId'] as String?, userId: json['userId'] as String?, createdAt: json['createdAt'] != null ? DateTime.parse(json['createdAt'] as String) : DateTime.now(), ); }