Line data Source code
1 : import 'package:freezed_annotation/freezed_annotation.dart'; 2 : import '../info/alternate_language.dart'; 3 : 4 : part 'document.freezed.dart'; 5 : part 'document.g.dart'; 6 : 7 : ///Document model 8 : /// 9 : ///Handle all the info of your Prismic.io document 10 : @freezed 11 : class Document with _$Document { 12 : ///Deafult factory constructor for Document 13 : factory Document({ 14 : @JsonKey(name: 'alternate_languages') 15 : List<AlternateLanguage>? alternateLanguages, 16 : @JsonKey(name: 'first_publication_date') String? firstPublicationDate, 17 : @JsonKey(name: 'last_publication_date') String? lastPublicationDate, 18 : @JsonKey(name: 'linked_documents') List<String>? linkedDocuments, 19 : required List<String> tags, 20 : required String id, 21 : required String lang, 22 : required String type, 23 : Map<String, dynamic>? data, 24 : List<String>? slugs, 25 : String? href, 26 : String? uid, 27 : }) = _Document; 28 : 29 : ///Creates a Document object from json 30 6 : factory Document.fromJson(Map<String, dynamic> json) => 31 6 : _$DocumentFromJson(json); 32 : }