feat: Converted to ios models

This commit is contained in:
Deven Joshi
2021-04-13 18:20:43 +05:30
parent 391eb8c1ce
commit fe07b8dbb0
36 changed files with 406 additions and 344 deletions
@@ -10,13 +10,13 @@ class Reaction {
/// Constructor used for json serialization
Reaction({
this.messageId,
this.createdAt,
this.type,
this.user,
required this.createdAt,
required this.type,
required this.user,
String? userId,
this.score,
required this.score,
this.extraData,
}) : userId = userId ?? user?.id;
}) : userId = userId ?? user.id;
/// Create a new instance from a json
factory Reaction.fromJson(Map<String, dynamic>? json) => _$ReactionFromJson(
@@ -26,18 +26,18 @@ class Reaction {
final String? messageId;
/// The type of the reaction
final String? type;
final String type;
/// The date of the reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
final DateTime? createdAt;
final DateTime createdAt;
/// The user that sent the reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)
final User? user;
final User user;
/// The score of the reaction (ie. number of reactions sent)
final int? score;
final int score;
/// The userId that sent the reaction
@JsonKey(includeIfNull: false, toJson: Serialization.readOnly)