1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-12-28 13:58:51 +00:00
comunicmobile/lib/models/notification.dart

70 lines
1.5 KiB
Dart
Raw Normal View History

import 'package:flutter/widgets.dart';
/// Notification model
///
/// @author Pierre HUBERT
enum NotificationElementType {
USER_PAGE,
GROUP_PAGE,
CONVERSATION,
CONVERSATION_MESSAGE,
POST,
POST_TEXT,
POST_IMAGE,
POST_YOUTUBE,
POST_MOVIE,
POST_WEBLINK,
POST_PDF,
POST_TIMER,
POST_SURVEY,
COMMENT,
FRIENDSHIP_REQUEST,
GROUP_MEMBERSHIP,
}
enum NotificationType {
COMMENT_CREATED,
SENT_FRIEND_REQUEST,
ACCEPTED_FRIEND_REQUEST,
REJECTED_FRIEND_REQUEST,
ELEM_CREATED,
ELEM_UPDATED,
SENT_GROUP_MEMBERSHIP_INVITATION,
ACCEPTED_GROUP_MEMBERSHIP_INVITATION,
REJECTED_GROUP_MEMBERSHIP_INVITATION,
SENT_GROUP_MEMBERSHIP_REQUEST,
ACCEPTED_GROUP_MEMBERSHIP_REQUEST,
REJECTED_GROUP_MEMBERSHIP_REQUEST,
}
class Notification {
final int id;
final int timeCreate;
final bool seen;
final int fromUser;
final int onElemId;
final NotificationElementType onElemType;
final NotificationType type;
final int fromContainerId;
final NotificationElementType fromContainerType;
const Notification({
@required this.id,
@required this.timeCreate,
@required this.seen,
@required this.fromUser,
@required this.onElemId,
@required this.onElemType,
@required this.type,
@required this.fromContainerId,
@required this.fromContainerType,
}) : assert(id != null),
assert(timeCreate != null),
assert(seen != null),
assert(fromUser != null),
assert(onElemId != null),
assert(onElemType != null),
assert(type != null);
}