mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-30 00:36:28 +00:00
41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
|
import 'package:flutter/widgets.dart';
|
||
|
|
||
|
/// Conversation member
|
||
|
///
|
||
|
/// @author Pierre Hubert
|
||
|
|
||
|
class ConversationMember {
|
||
|
final int userID;
|
||
|
final int lastMessageSeen;
|
||
|
final int lastAccessTime;
|
||
|
final bool following;
|
||
|
final bool isAdmin;
|
||
|
|
||
|
const ConversationMember({
|
||
|
@required this.userID,
|
||
|
@required this.lastMessageSeen,
|
||
|
@required this.lastAccessTime,
|
||
|
@required this.following,
|
||
|
@required this.isAdmin,
|
||
|
}) : assert(userID != null),
|
||
|
assert(lastMessageSeen != null),
|
||
|
assert(lastAccessTime != null),
|
||
|
assert(following != null),
|
||
|
assert(isAdmin != null);
|
||
|
|
||
|
Map<String, dynamic> toJson() => {
|
||
|
'userID': userID,
|
||
|
'lastMessageSeen': lastMessageSeen,
|
||
|
'lastAccessTime': lastAccessTime,
|
||
|
'following': following,
|
||
|
'isAdmin': isAdmin,
|
||
|
};
|
||
|
|
||
|
ConversationMember.fromJSON(Map<String, dynamic> json)
|
||
|
: userID = json["userID"],
|
||
|
lastMessageSeen = json["lastMessageSeen"],
|
||
|
lastAccessTime = json["lastAccessTime"],
|
||
|
following = json["following"],
|
||
|
isAdmin = json["isAdmin"];
|
||
|
}
|