Notification Domain Model
Component Detail
Data Layer
low complexity
mobile
0
Dependencies
0
Dependents
1
Entities
0
Integrations
Description
Typed Dart data class representing a single notification record from the Supabase notifications table. Encapsulates all fields (user_id, type enum, JSONB payload, read_at nullable, created_at) with factory constructors for database row parsing and JSON serialization. Provides computed properties such as isRead and relativeTimestamp.
notification-model
Responsibilities
- Represent a single notification with all database fields
- Parse from Supabase database row map
- Expose typed payload sub-models per notification type
- Provide computed isRead property from read_at nullability
- Provide relative timestamp formatting
Interfaces
Notification.fromMap(Map<String, dynamic>)
toMap()
copyWith({...})
get isRead: bool
get relativeTimestamp: String
get payload: NotificationPayload
get typeIcon: IconData