forked from CarGuo/gsy_github_app_flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.dart
More file actions
41 lines (34 loc) · 848 Bytes
/
Event.dart
File metadata and controls
41 lines (34 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import 'package:gsy_github_app_flutter/common/model/EventPayload.dart';
import 'package:gsy_github_app_flutter/common/model/Repository.dart';
import 'package:gsy_github_app_flutter/common/model/User.dart';
import 'package:json_annotation/json_annotation.dart';
/**
* Created by guoshuyu
* Date: 2018-07-31
*/
part 'Event.g.dart';
@JsonSerializable()
class Event {
String id;
String type;
User actor;
Repository repo;
User org;
EventPayload payload;
@JsonKey(name: "public")
bool isPublic;
@JsonKey(name: "created_at")
DateTime createdAt;
Event(
this.id,
this.type,
this.actor,
this.repo,
this.org,
this.payload,
this.isPublic,
this.createdAt,
);
factory Event.fromJson(Map<String, dynamic> json) => _$EventFromJson(json);
Map<String, dynamic> toJson() => _$EventToJson(this);
}