Add methods and fields for comments associated with post.
This commit is contained in:
Mikwk 2020-08-05 17:03:21 +02:00
parent b5e8620931
commit cf09486479
1 changed files with 46 additions and 44 deletions

View File

@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
part 'post.g.dart';
//TODO: Add methods and fields for comments associated with post.
@JsonSerializable()
class PostView {
PostView(
@ -47,7 +48,8 @@ class PostView {
int myVote,
bool subscribed,
bool read,
bool saved) {
bool saved,
) {
_userId = userId;
_myVote = myVote;
_subscribed = subscribed;
@ -186,7 +188,7 @@ class PostView {
return _myVote;
}
void set myVote(int myVote) => _myVote = myVote>0?1:myVote<0?-1:0;
void set myVote(int myVote) => _myVote = myVote > 0 ? 1 : myVote < 0 ? -1 : 0;
@JsonKey(name: "my_vote")
int _myVote;