From 470e70be2ba9e2ef0d1d758001b9dc0e88029348 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 11 Dec 2024 14:10:58 +0800 Subject: [PATCH 1/2] mod: like message type --- lib/pages/message/like/view.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pages/message/like/view.dart b/lib/pages/message/like/view.dart index 42c5a2ed..0d44cfdb 100644 --- a/lib/pages/message/like/view.dart +++ b/lib/pages/message/like/view.dart @@ -197,13 +197,13 @@ class LikeItem extends StatelessWidget { ), ), const SizedBox(width: 25), - if (type == 'reply' || type == 'danmu') + if (type == 'reply' || type == 'danmu' || type == 'dynamic') Container( width: 60, height: 60, padding: const EdgeInsets.all(4), child: Text( - item.item!.title!, + item.item?.title ?? '', maxLines: 4, style: const TextStyle(fontSize: 12, letterSpacing: 0.3), overflow: TextOverflow.ellipsis, From 9a20f246d31b0da82ebd9356d79021bbd99a8d05 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Wed, 11 Dec 2024 23:08:04 +0800 Subject: [PATCH 2/2] mod --- lib/common/widgets/html_render.dart | 2 +- lib/pages/bangumi/introduction/view.dart | 16 ++++++++-------- lib/pages/follow/widgets/follow_item.dart | 2 +- lib/pages/member_dynamics/view.dart | 3 ++- lib/pages/video/detail/introduction/view.dart | 1 - lib/pages/video/detail/view.dart | 1 - lib/pages/whisper_detail/widget/chat_item.dart | 4 ++-- lib/utils/recommend_filter.dart | 2 -- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/common/widgets/html_render.dart b/lib/common/widgets/html_render.dart index e4e3ef77..a2114883 100644 --- a/lib/common/widgets/html_render.dart +++ b/lib/common/widgets/html_render.dart @@ -59,7 +59,7 @@ class HtmlRender extends StatelessWidget { imgUrl = imgUrl.replaceAll('http://', 'https://'); } imgUrl = imgUrl.contains('@') ? imgUrl.split('@').first : imgUrl; - final bool isEmote = imgUrl.contains('/emote/'); + // final bool isEmote = imgUrl.contains('/emote/'); final bool isMall = imgUrl.contains('/mall/'); if (isMall) { return const SizedBox(); diff --git a/lib/pages/bangumi/introduction/view.dart b/lib/pages/bangumi/introduction/view.dart index 4fc6a1b1..792d9f06 100644 --- a/lib/pages/bangumi/introduction/view.dart +++ b/lib/pages/bangumi/introduction/view.dart @@ -22,10 +22,10 @@ import 'controller.dart'; import 'widgets/intro_detail.dart'; class BangumiIntroPanel extends StatefulWidget { - final int? cid; + final int cid; const BangumiIntroPanel({ Key? key, - this.cid, + required this.cid, }) : super(key: key); @override @@ -49,7 +49,7 @@ class _BangumiIntroPanelState extends State void initState() { super.initState(); heroTag = Get.arguments['heroTag']; - cid = widget.cid!; + cid = widget.cid; bangumiIntroController = Get.put(BangumiIntroController(), tag: heroTag); videoDetailCtr = Get.find(tag: heroTag); _futureBuilderFuture = bangumiIntroController.queryBangumiIntro(); @@ -103,11 +103,11 @@ class BangumiInfo extends StatefulWidget { const BangumiInfo({ super.key, this.bangumiDetail, - this.cid, + required this.cid, }); final BangumiInfoModel? bangumiDetail; - final int? cid; + final int cid; @override State createState() => _BangumiInfoState(); @@ -119,7 +119,7 @@ class _BangumiInfoState extends State { late final VideoDetailController videoDetailCtr; Box localCache = GStorage.localCache; late double sheetHeight; - int? cid; + late int cid; bool isProcessing = false; void Function()? handleState(Future Function() action) { return isProcessing @@ -137,7 +137,7 @@ class _BangumiInfoState extends State { bangumiIntroController = Get.put(BangumiIntroController(), tag: heroTag); videoDetailCtr = Get.find(tag: heroTag); sheetHeight = localCache.get('sheetHeight'); - cid = widget.cid!; + cid = widget.cid; videoDetailCtr.cid.listen((p0) { cid = p0; if (!mounted) { @@ -313,7 +313,7 @@ class _BangumiInfoState extends State { if (widget.bangumiDetail!.episodes!.isNotEmpty) ...[ BangumiPanel( pages: widget.bangumiDetail!.episodes!, - cid: cid! ?? widget.bangumiDetail!.episodes!.first.cid!, + cid: cid, sheetHeight: sheetHeight, changeFuc: (bvid, cid, aid, cover) => bangumiIntroController .changeSeasonOrbangu(bvid, cid, aid, cover), diff --git a/lib/pages/follow/widgets/follow_item.dart b/lib/pages/follow/widgets/follow_item.dart index c8fdcbad..e11b5ec3 100644 --- a/lib/pages/follow/widgets/follow_item.dart +++ b/lib/pages/follow/widgets/follow_item.dart @@ -47,7 +47,7 @@ class FollowItem extends StatelessWidget { height: 34, child: TextButton( onPressed: () async { - int followStatus = await FollowUtils( + await FollowUtils( context: context, followStatus: 2, mid: item.mid!, diff --git a/lib/pages/member_dynamics/view.dart b/lib/pages/member_dynamics/view.dart index d7031012..264817e5 100644 --- a/lib/pages/member_dynamics/view.dart +++ b/lib/pages/member_dynamics/view.dart @@ -1,6 +1,7 @@ import 'package:easy_debounce/easy_throttle.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:pilipala/common/widgets/no_data.dart'; import 'package:pilipala/pages/member_dynamics/index.dart'; import 'package:pilipala/utils/utils.dart'; @@ -82,7 +83,7 @@ class _MemberDynamicsPageState extends State { childCount: list.length, ), ) - : const SliverToBoxAdapter(), + : const NoData(), ); } else { return HttpError( diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index aac1d657..a4403181 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -18,7 +18,6 @@ import 'package:pilipala/models/video_detail_res.dart'; import 'package:pilipala/pages/video/detail/introduction/controller.dart'; import 'package:pilipala/pages/video/detail/widgets/ai_detail.dart'; import 'package:pilipala/utils/feed_back.dart'; -import 'package:pilipala/utils/follow.dart'; import 'package:pilipala/utils/global_data_cache.dart'; import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/utils.dart'; diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index bc953d21..51b69945 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -32,7 +32,6 @@ import 'package:status_bar_control/status_bar_control.dart'; import '../../../plugin/pl_player/models/bottom_control_type.dart'; import '../../../services/shutdown_timer_service.dart'; import 'widgets/app_bar.dart'; -import 'widgets/header_control.dart'; class VideoDetailPage extends StatefulWidget { const VideoDetailPage({Key? key}) : super(key: key); diff --git a/lib/pages/whisper_detail/widget/chat_item.dart b/lib/pages/whisper_detail/widget/chat_item.dart index 64e16c9f..73d5b51f 100644 --- a/lib/pages/whisper_detail/widget/chat_item.dart +++ b/lib/pages/whisper_detail/widget/chat_item.dart @@ -59,11 +59,11 @@ class ChatItem extends StatelessWidget { bool isOwner = item.senderUid == GStorage.userInfo.get('userInfoCache').mid; bool isPic = item.msgType == MsgType.pic.value; // 图片 - bool isText = item.msgType == MsgType.text.value; // 文本 + // bool isText = item.msgType == MsgType.text.value; // 文本 // bool isArchive = item.msgType == 11; // 投稿 // bool isArticle = item.msgType == 12; // 专栏 bool isRevoke = item.msgType == MsgType.revoke.value; // 撤回消息 - bool isShareV2 = item.msgType == MsgType.share_v2.value; + // bool isShareV2 = item.msgType == MsgType.share_v2.value; bool isSystem = item.msgType == MsgType.notify_text.value || item.msgType == MsgType.notify_msg.value || item.msgType == MsgType.pic_card.value || diff --git a/lib/utils/recommend_filter.dart b/lib/utils/recommend_filter.dart index 29907c63..b0e65b9a 100644 --- a/lib/utils/recommend_filter.dart +++ b/lib/utils/recommend_filter.dart @@ -1,5 +1,3 @@ -import 'dart:math'; - import 'storage.dart'; class RecommendFilter {