File tree Expand file tree Collapse file tree 4 files changed +35
-15
lines changed Expand file tree Collapse file tree 4 files changed +35
-15
lines changed Original file line number Diff line number Diff line change 1
1
class ActivityPubObject {
2
- List <ActivityPubObject >? attachments;
2
+ final List <ActivityPubObject >? attachment;
3
+ final String ? content;
4
+ final String ? attributedTo;
5
+
6
+ ActivityPubObject (
7
+ this .attachment,
8
+ this .content,
9
+ this .attributedTo,
10
+ );
3
11
}
Original file line number Diff line number Diff line change @@ -13,12 +13,21 @@ class Document extends ActivityPubObject {
13
13
this .mediaType,
14
14
this .context,
15
15
this .url,
16
- );
16
+ ) : super (
17
+ null ,
18
+ null ,
19
+ null ,
20
+ );
17
21
18
22
Document .fromJson (Map <String , dynamic > json)
19
23
: type = json["type" ],
20
24
mediaType = json["mediaType" ],
21
25
url = Uri .tryParse (json["url" ]),
22
26
name = json["name" ],
23
- context = json["@context" ];
27
+ context = json["@context" ],
28
+ super (
29
+ null ,
30
+ null ,
31
+ null ,
32
+ );
24
33
}
Original file line number Diff line number Diff line change @@ -9,44 +9,47 @@ class Post extends ActivityPubObject {
9
9
final String ? summary;
10
10
final bool ? sensitive;
11
11
final String ? inReplyTo;
12
- final String content;
13
12
final String id;
14
13
final String type;
15
14
final DateTime published;
16
- final String attributedTo;
17
15
final Collection ? replies;
18
- final List <Document >? attachment;
19
16
20
17
Post (
21
18
this .to,
22
19
this .name,
23
20
this .summary,
24
21
this .sensitive,
25
22
this .inReplyTo,
26
- this . content,
23
+ content,
27
24
this .id,
28
25
this .type,
29
26
this .published,
30
- this . attributedTo,
27
+ attributedTo,
31
28
this .replies,
32
- this .attachment,
33
- );
29
+ attachment,
30
+ ) : super (
31
+ attachment,
32
+ content,
33
+ attributedTo,
34
+ );
34
35
35
36
Post .fromJson (Map <String , dynamic > json)
36
37
: to = convertToStringList (json["to" ]),
37
38
name = json["name" ],
38
39
summary = json["summary" ],
39
40
sensitive = json["sensitive" ],
40
41
inReplyTo = json["inReplyTo" ],
41
- content = json["content" ],
42
42
id = json["id" ],
43
43
type = json["type" ],
44
44
published = DateTime .parse (json["published" ]),
45
- attributedTo = json["attributedTo" ],
46
- attachment = toListOfDocuments (json["attachment" ]),
47
45
replies = json["replies" ] == null
48
46
? null
49
- : Collection .fromJson (json["replies" ]);
47
+ : Collection .fromJson (json["replies" ]),
48
+ super (
49
+ json["attachment" ],
50
+ json["content" ],
51
+ json["attributedTo" ],
52
+ );
50
53
51
54
static List <String > convertToStringList (json) {
52
55
List <String > jsonList = [];
Original file line number Diff line number Diff line change 1
1
name : activitypub
2
2
description : A library for the ActivityPub standard. Created an also used by Fedodo.
3
- version : 1.2.4
3
+ version : 1.2.5
4
4
repository : https://github.com/Fedodo/Fedodo.Pub.ActivityPub
5
5
6
6
environment :
You can’t perform that action at this time.
0 commit comments