Line data Source code
1 : import 'package:json_annotation/json_annotation.dart'; 2 : part 'syncmodel.g.dart'; 3 : 4 : @JsonSerializable(createFactory: true) 5 : class SyncModel { 6 : final List items; 7 : final int skip; 8 : final int limit; 9 : @JsonKey(name: "total_count") 10 : final int totalCount; 11 : @JsonKey(name: "sync_token") 12 : final String syncToken; 13 : 14 1 : SyncModel(this.items, this.skip, this.limit, this.totalCount, this.syncToken); 15 2 : factory SyncModel.fromJson(Map<String, dynamic> json) => _$SyncModelFromJson(json); 16 2 : Map<String, dynamic> toJson() => _$SyncModelToJson(this); 17 : } 18 : 19 : @JsonSerializable() 20 : class Items{ 21 : final String type; 22 : final String eventAt; 23 : final String contentTypeUid; 24 : final List data; 25 : 26 0 : Items(this.type, this.eventAt, this.contentTypeUid, this.data); 27 0 : factory Items.fromJson(Map<String, dynamic> json) => _$ItemsFromJson(json); 28 0 : Map<String, dynamic> toJson() => _$ItemsToJson(this); 29 : } 30 : 31 : 32 : 33 : @JsonSerializable() 34 : class Data{ 35 : final String uid; 36 : final String locale; 37 : final String title; 38 : 39 0 : Data(this.uid, this.locale, this.title); 40 0 : factory Data.fromJson(Map<String, dynamic> json) => _$DataFromJson(json); 41 0 : Map<String, dynamic> toJson() => _$DataToJson(this); 42 : }