// ignore_for_file: invalid_annotation_target import 'package:freezed_annotation/freezed_annotation.dart'; part 'page_info.freezed.dart'; part 'page_info.g.dart'; @freezed class PageInfo with _$PageInfo { const PageInfo._(); factory PageInfo({ required int pageid, required int ns, required String title, String? subtitle, String? displayTitle, @JsonKey(name: "extract") String? description, String? contentmodel, String? pagelanguage, String? pagelanguagehtmlcode, String? pagelanguagedir, bool? inwatchlist, @JsonKey(name: "touched") DateTime? updatedTime, int? lastrevid, int? length, String? fullurl, String? editurl, String? canonicalurl, }) = _PageInfo; String get mainTitle { return displayTitle ?? title; } String? get mainCategory { return null; } factory PageInfo.fromJson(Map json) => _$PageInfoFromJson(json); } @freezed class PagesResponse with _$PagesResponse { factory PagesResponse({required List pages}) = _PageResponse; factory PagesResponse.fromJson(Map json) => _$PagesResponseFromJson(json); } @freezed class PageImageInfo with _$PageImageInfo { factory PageImageInfo({required String source, int? width, int? height}) = _PageImageInfo; factory PageImageInfo.fromJson(Map json) => _$PageImageInfoFromJson(json); }