Skip to content

Instantly share code, notes, and snippets.

@hasimyerlikaya
Last active April 29, 2019 05:40
Show Gist options
  • Save hasimyerlikaya/21e3b47858e85bd6552feccca35ef984 to your computer and use it in GitHub Desktop.
Save hasimyerlikaya/21e3b47858e85bd6552feccca35ef984 to your computer and use it in GitHub Desktop.
Json Serializable Model
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