import 'package:json_annotation/json_annotation.dart'; part 'parse.g.dart'; @JsonSerializable() class MWParseCategoryInfo { String sortkey; String category; MWParseCategoryInfo({ this.sortkey = "", this.category = "", }); factory MWParseCategoryInfo.fromJson(Map json) => _$MWParseCategoryInfoFromJson(json); Map toJson() => _$MWParseCategoryInfoToJson(this); } @JsonSerializable() class MWParseLangLinkInfo { String lang; String url; String langname; String autonym; String title; MWParseLangLinkInfo({ this.lang = "", this.url = "", this.langname = "", this.autonym = "", this.title = "", }); factory MWParseLangLinkInfo.fromJson(Map json) => _$MWParseLangLinkInfoFromJson(json); Map toJson() => _$MWParseLangLinkInfoToJson(this); } @JsonSerializable() class MWParsePageLinkInfo { int ns; String title; bool exists; MWParsePageLinkInfo({ this.ns = -1, this.title = "", this.exists = false, }); factory MWParsePageLinkInfo.fromJson(Map json) => _$MWParsePageLinkInfoFromJson(json); Map toJson() => _$MWParsePageLinkInfoToJson(this); } @JsonSerializable() class MWParseSectionInfo { int toclevel; int level; String line; String number; String index; String fromtitle; int? byteoffset; String anchor; MWParseSectionInfo({ this.toclevel = -1, this.level = -1, this.line = "", this.number = "", this.index = "", this.fromtitle = "", this.byteoffset, this.anchor = "", }); factory MWParseSectionInfo.fromJson(Map json) => _$MWParseSectionInfoFromJson(json); Map toJson() => _$MWParseSectionInfoToJson(this); } @JsonSerializable() class MWParseInfo { String title; int pageid; int revid; String text; List langlink; List categories; List links; List templates; List images; List externallinks; List sections; bool showtoc; String displaytitle; List modules; List modulescripts; List modulestyles; Map jsconfigvars; Map iwlinks; Map properties; MWParseInfo({ this.title = "", this.pageid = -1, this.revid = -1, this.text = "", this.langlink = const [], this.categories = const [], this.links = const [], this.templates = const [], this.images = const [], this.externallinks = const [], this.sections = const [], this.showtoc = true, this.displaytitle = "", this.modules = const [], this.modulescripts = const [], this.modulestyles = const [], this.jsconfigvars = const {}, this.iwlinks = const {}, this.properties = const {}, }); factory MWParseInfo.fromJson(Map json) => _$MWParseInfoFromJson(json); Map toJson() => _$MWParseInfoToJson(this); } @JsonSerializable() class MWParseResponse { MWParseInfo parse; MWParseResponse({required this.parse}); factory MWParseResponse.fromJson(Map json) => _$MWParseResponseFromJson(json); Map toJson() => _$MWParseResponseToJson(this); }