Last active
April 29, 2019 05:40
-
-
Save hasimyerlikaya/21e3b47858e85bd6552feccca35ef984 to your computer and use it in GitHub Desktop.
Json Serializable Model
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
import 'package:json_annotation/json_annotation.dart'; | |
part 'publication_document.g.dart'; | |
@JsonSerializable() | |
class PublicationDocument { | |
final int id; | |
final int publicationId; | |
final DateTime publicationDate; | |
final DateTime createTime; | |
final DateTime updateTime; | |
final bool isFree; | |
PublicationDocument({ | |
this.id, | |
this.publicationId, | |
this.publicationDate, | |
this.createTime, | |
this.updateTime, | |
this.isFree, | |
}); | |
factory PublicationDocument.fromJson(Map<String, dynamic> json) => | |
_$PublicationDocumentFromJson(json); | |
Map<String, dynamic> toJson() => _$PublicationDocumentToJson(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment