import 'package:pilipala/models/video/reply/item.dart'; import 'config.dart'; import 'page.dart'; import 'upper.dart'; class ReplyData { ReplyData({ this.cursor, this.config, this.replies, this.topReplies, this.upper, }); ReplyCursor? cursor; ReplyConfig? config; late List? replies; late List? topReplies; ReplyUpper? upper; ReplyData.fromJson(Map json) { cursor = ReplyCursor.fromJson(json['cursor']); config = ReplyConfig.fromJson(json['config']); replies = json['replies'] != null ? json['replies'] .map( (item) => ReplyItemModel.fromJson(item, json['upper']['mid'])) .toList() : []; topReplies = json['top_replies'] != null ? json['top_replies'] .map((item) => ReplyItemModel.fromJson( item, json['upper']['mid'], isTopStatus: true)) .toList() : []; upper = ReplyUpper.fromJson(json['upper']); } } class ReplyCursor { ReplyCursor({ this.isBegin, this.prev, this.next, this.isEnd, this.mode, this.modeText, this.allCount, this.supportMode, this.name, this.paginationReply, this.sessionId, }); bool? isBegin; int? prev; int? next; bool? isEnd; int? mode; String? modeText; int? allCount; List? supportMode; String? name; PaginationReply? paginationReply; String? sessionId; ReplyCursor.fromJson(Map json) { isBegin = json['is_begin']; prev = json['prev']; next = json['next']; isEnd = json['is_end']; mode = json['mode']; modeText = json['mode_text']; allCount = json['all_count'] ?? 0; supportMode = json['support_mode'].cast(); name = json['name']; paginationReply = json['pagination_reply'] != null ? PaginationReply.fromJson(json['pagination_reply']) : null; sessionId = json['session_id']; } } class PaginationReply { PaginationReply({ this.nextOffset, this.prevOffset, }); String? nextOffset; String? prevOffset; PaginationReply.fromJson(Map json) { nextOffset = json['next_offset']; prevOffset = json['prev_offset']; } } class ReplyReplyData { ReplyReplyData({ this.page, this.config, this.replies, this.root, this.topReplies, this.upper, }); ReplyPage? page; ReplyConfig? config; late List? replies; ReplyItemModel? root; late List? topReplies; ReplyUpper? upper; ReplyReplyData.fromJson(Map json) { page = ReplyPage.fromJson(json['page']); config = ReplyConfig.fromJson(json['config']); replies = json['replies'] != null ? json['replies'] .map( (item) => ReplyItemModel.fromJson(item, json['upper']['mid'])) .toList() : []; root = json['root'] != null ? ReplyItemModel.fromJson(json['root'], false) : null; topReplies = json['top_replies'] != null ? json['top_replies'] .map((item) => ReplyItemModel.fromJson( item, json['upper']['mid'], isTopStatus: true)) .toList() : []; upper = ReplyUpper.fromJson(json['upper']); } }