This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #363 from OkunaOrg/feature/138-mentions
Feature/138 mentions
- Loading branch information
Showing
24 changed files
with
1,645 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
lib/models/notifications/post_comment_user_mention_notification.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import 'package:Okuna/models/post_comment_user_mention.dart'; | ||
|
||
class PostCommentUserMentionNotification { | ||
final int id; | ||
final PostCommentUserMention postCommentUserMention; | ||
|
||
PostCommentUserMentionNotification({this.id, this.postCommentUserMention}); | ||
|
||
factory PostCommentUserMentionNotification.fromJson( | ||
Map<String, dynamic> json) { | ||
return PostCommentUserMentionNotification( | ||
id: json['id'], | ||
postCommentUserMention: | ||
_parsePostCommentUserMention(json['post_comment_user_mention'])); | ||
} | ||
|
||
static PostCommentUserMention _parsePostCommentUserMention( | ||
Map postCommentUserMentionData) { | ||
return PostCommentUserMention.fromJSON(postCommentUserMentionData); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/models/notifications/post_user_mention_notification.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'package:Okuna/models/post_user_mention.dart'; | ||
|
||
class PostUserMentionNotification { | ||
final int id; | ||
final PostUserMention postUserMention; | ||
|
||
PostUserMentionNotification({this.id, this.postUserMention}); | ||
|
||
factory PostUserMentionNotification.fromJson(Map<String, dynamic> json) { | ||
return PostUserMentionNotification( | ||
id: json['id'], | ||
postUserMention: _parsePostUserMention(json['post_user_mention'])); | ||
} | ||
|
||
static PostUserMention _parsePostUserMention(Map postUserMentionData) { | ||
return PostUserMention.fromJSON(postUserMentionData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:Okuna/models/post_comment.dart'; | ||
import 'package:Okuna/models/user.dart'; | ||
|
||
class PostCommentUserMention { | ||
final int id; | ||
final User user; | ||
final PostComment postComment; | ||
|
||
PostCommentUserMention({ | ||
this.id, | ||
this.user, | ||
this.postComment, | ||
}); | ||
|
||
factory PostCommentUserMention.fromJSON(Map<String, dynamic> parsedJson) { | ||
return PostCommentUserMention( | ||
id: parsedJson['id'], | ||
user: parseUser(parsedJson['user']), | ||
postComment: parsePostComment(parsedJson['post_comment']), | ||
); | ||
} | ||
|
||
static User parseUser(Map userData) { | ||
if (userData == null) return null; | ||
return User.fromJson(userData); | ||
} | ||
|
||
static PostComment parsePostComment(Map postCommentData) { | ||
if (postCommentData == null) return null; | ||
return PostComment.fromJSON(postCommentData); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:Okuna/models/post.dart'; | ||
import 'package:Okuna/models/user.dart'; | ||
|
||
class PostUserMention { | ||
final int id; | ||
final User user; | ||
final Post post; | ||
|
||
PostUserMention({ | ||
this.id, | ||
this.user, | ||
this.post, | ||
}); | ||
|
||
factory PostUserMention.fromJSON(Map<String, dynamic> parsedJson) { | ||
return PostUserMention( | ||
id: parsedJson['id'], | ||
user: parseUser(parsedJson['user']), | ||
post: parsePost(parsedJson['post']), | ||
); | ||
} | ||
|
||
static User parseUser(Map userData) { | ||
if (userData == null) return null; | ||
return User.fromJson(userData); | ||
} | ||
|
||
static Post parsePost(Map postData) { | ||
if (postData == null) return null; | ||
return Post.fromJson(postData); | ||
} | ||
} |
Oops, something went wrong.