You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
3.3 KiB
Dart
148 lines
3.3 KiB
Dart
2 years ago
|
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<String, dynamic> json) =>
|
||
|
_$MWParseCategoryInfoFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> 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<String, dynamic> json) =>
|
||
|
_$MWParseLangLinkInfoFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> 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<String, dynamic> json) =>
|
||
|
_$MWParsePageLinkInfoFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> 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<String, dynamic> json) =>
|
||
|
_$MWParseSectionInfoFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> toJson() => _$MWParseSectionInfoToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class MWParseInfo {
|
||
|
String title;
|
||
|
int pageid;
|
||
|
int revid;
|
||
|
String text;
|
||
|
List<MWParseLangLinkInfo> langlink;
|
||
|
List<MWParseCategoryInfo> categories;
|
||
|
List<MWParsePageLinkInfo> links;
|
||
|
List<MWParsePageLinkInfo> templates;
|
||
|
List<String> images;
|
||
|
List<String> externallinks;
|
||
|
List<MWParseSectionInfo> sections;
|
||
|
bool showtoc;
|
||
|
String displaytitle;
|
||
|
List<String> modules;
|
||
|
List<String> modulescripts;
|
||
|
List<String> modulestyles;
|
||
|
Map<String, dynamic> jsconfigvars;
|
||
|
Map<String, dynamic> iwlinks;
|
||
|
Map<String, dynamic> 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<String, dynamic> json) => _$MWParseInfoFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> toJson() => _$MWParseInfoToJson(this);
|
||
|
}
|
||
|
|
||
|
@JsonSerializable()
|
||
|
class MWParseResponse {
|
||
|
MWParseInfo parse;
|
||
|
|
||
|
MWParseResponse({required this.parse});
|
||
|
|
||
|
factory MWParseResponse.fromJson(Map<String, dynamic> json) => _$MWParseResponseFromJson(json);
|
||
|
|
||
|
Map<String, dynamic> toJson() => _$MWParseResponseToJson(this);
|
||
|
}
|