From abdde1f811c54a31591e5bae20ce72f344fdf66a Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sun, 20 Apr 2025 21:01:17 +0800 Subject: [PATCH] opt: pic Signed-off-by: bggRGjQaUbCoE --- lib/pages/dynamics/widgets/author_panel.dart | 5 +++-- lib/pages/dynamics/widgets/dynamic_panel.dart | 4 +++- lib/pages/hot/view.dart | 4 +++- lib/pages/live_room/view.dart | 6 +++--- lib/pages/member/widget/edit_profile_page.dart | 2 +- lib/pages/member/widget/user_info_card.dart | 16 +++++++++------- lib/pages/search/widgets/hot_keyword.dart | 3 ++- lib/pages/search_trending/view.dart | 4 ++-- .../introduction/widgets/create_fav_page.dart | 3 +-- .../detail/reply/widgets/reply_item_grpc.dart | 5 +++-- 10 files changed, 30 insertions(+), 22 deletions(-) diff --git a/lib/pages/dynamics/widgets/author_panel.dart b/lib/pages/dynamics/widgets/author_panel.dart index 639fbf94..7e62c50a 100644 --- a/lib/pages/dynamics/widgets/author_panel.dart +++ b/lib/pages/dynamics/widgets/author_panel.dart @@ -162,8 +162,9 @@ class AuthorPanel extends StatelessWidget { children: [ CachedNetworkImage( height: 32, - imageUrl: item - .modules.moduleAuthor.decorate['card_url'], + imageUrl: (item.modules.moduleAuthor + .decorate['card_url'] as String) + .http2https, ), if ((item.modules.moduleAuthor.decorate?['fan'] ?['num_str'] as String?) diff --git a/lib/pages/dynamics/widgets/dynamic_panel.dart b/lib/pages/dynamics/widgets/dynamic_panel.dart index 84c45718..b5b20a69 100644 --- a/lib/pages/dynamics/widgets/dynamic_panel.dart +++ b/lib/pages/dynamics/widgets/dynamic_panel.dart @@ -1,6 +1,7 @@ import 'package:PiliPlus/common/widgets/image_save.dart'; import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/page_utils.dart'; +import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -106,7 +107,8 @@ class DynamicPanel extends StatelessWidget { child: CachedNetworkImage( width: 60, height: 60, - imageUrl: item.modules.moduleAuthor.pendant['image'], + imageUrl: Utils.thumbnailImgUrl( + item.modules.moduleAuthor.pendant['image']), ), ), ), diff --git a/lib/pages/hot/view.dart b/lib/pages/hot/view.dart index df1d630f..ca946661 100644 --- a/lib/pages/hot/view.dart +++ b/lib/pages/hot/view.dart @@ -5,6 +5,7 @@ import 'package:PiliPlus/models/common/tab_type.dart'; import 'package:PiliPlus/models/model_hot_video_item.dart'; import 'package:PiliPlus/pages/common/common_page.dart'; import 'package:PiliPlus/pages/rank/view.dart'; +import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; @@ -42,7 +43,8 @@ class _HotPageState extends CommonPageState child: Column( mainAxisSize: MainAxisSize.min, children: [ - CachedNetworkImage(width: 35, height: 35, imageUrl: iconUrl), + CachedNetworkImage( + width: 35, height: 35, imageUrl: Utils.thumbnailImgUrl(iconUrl)), const SizedBox(height: 4), Text( title, diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index f1a2ff05..f0bfd26c 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -6,7 +6,6 @@ import 'package:PiliPlus/pages/live_room/send_dm_panel.dart'; import 'package:PiliPlus/pages/live_room/widgets/chat.dart'; import 'package:PiliPlus/pages/live_room/widgets/header_control.dart'; import 'package:PiliPlus/services/service_locator.dart'; -import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/page_utils.dart'; import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; @@ -229,8 +228,9 @@ class _LiveRoomPageState extends State fit: BoxFit.cover, width: Get.width, height: Get.height, - imageUrl: _liveRoomController.roomInfoH5.value - .roomInfo!.appBackground!.http2https, + imageUrl: Utils.thumbnailImgUrl( + _liveRoomController.roomInfoH5.value.roomInfo! + .appBackground!), ) : Image.asset( 'assets/images/live/default_bg.webp', diff --git a/lib/pages/member/widget/edit_profile_page.dart b/lib/pages/member/widget/edit_profile_page.dart index 2e231b74..fcf3fd0f 100644 --- a/lib/pages/member/widget/edit_profile_page.dart +++ b/lib/pages/member/widget/edit_profile_page.dart @@ -100,7 +100,7 @@ class _EditProfilePageState extends State { child: ClipOval( child: CachedNetworkImage( imageUrl: - (loadingState.response['face'] as String).http2https, + Utils.thumbnailImgUrl(loadingState.response['face']), ), ), ), diff --git a/lib/pages/member/widget/user_info_card.dart b/lib/pages/member/widget/user_info_card.dart index 0b3421c8..db65655c 100644 --- a/lib/pages/member/widget/user_info_card.dart +++ b/lib/pages/member/widget/user_info_card.dart @@ -86,7 +86,7 @@ class UserInfoCard extends StatelessWidget { ); }, child: CachedNetworkImage( - imageUrl: imgUrl?.http2https ?? '', + imageUrl: Utils.thumbnailImgUrl(imgUrl), width: double.infinity, height: 135, imageBuilder: (context, imageProvider) => Container( @@ -176,7 +176,8 @@ class UserInfoCard extends StatelessWidget { child: CachedNetworkImage( width: 18, height: 18, - imageUrl: card.officialVerify!.icon!.http2https, + imageUrl: + Utils.thumbnailImgUrl(card.officialVerify!.icon!), ), ), ), @@ -412,7 +413,7 @@ class UserInfoCard extends StatelessWidget { ), child: card.officialVerify?.icon?.isNotEmpty == true ? CachedNetworkImage( - imageUrl: card.officialVerify!.icon!.http2https, + imageUrl: Utils.thumbnailImgUrl(card.officialVerify!.icon!), width: 22, height: 22, ) @@ -478,7 +479,7 @@ class UserInfoCard extends StatelessWidget { child: CachedNetworkImage( width: 140, height: 140, - imageUrl: card.pendant!.image!, + imageUrl: Utils.thumbnailImgUrl(card.pendant!.image!), ), ), ), @@ -543,13 +544,13 @@ class UserInfoCard extends StatelessWidget { children: [ if (isDark && card.prInfo?.iconNight?.isNotEmpty == true) ...[ CachedNetworkImage( - imageUrl: card.prInfo!.iconNight!, + imageUrl: Utils.thumbnailImgUrl(card.prInfo!.iconNight!), height: 20, ), const SizedBox(width: 16), ] else if (card.prInfo?.icon?.isNotEmpty == true) ...[ CachedNetworkImage( - imageUrl: card.prInfo!.icon!, + imageUrl: Utils.thumbnailImgUrl(card.prInfo!.icon!), height: 20, ), const SizedBox(width: 16), @@ -636,7 +637,8 @@ class UserInfoCard extends StatelessWidget { child: CachedNetworkImage( width: 140, height: 140, - imageUrl: card.pendant!.image!, + imageUrl: + Utils.thumbnailImgUrl(card.pendant!.image!), ), ), ), diff --git a/lib/pages/search/widgets/hot_keyword.dart b/lib/pages/search/widgets/hot_keyword.dart index 23e1a91e..3588b583 100644 --- a/lib/pages/search/widgets/hot_keyword.dart +++ b/lib/pages/search/widgets/hot_keyword.dart @@ -1,5 +1,6 @@ import 'package:PiliPlus/models/search/search_trending/trending_list.dart'; import 'package:PiliPlus/utils/extension.dart'; +import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -52,7 +53,7 @@ class HotKeyword extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 4), child: CachedNetworkImage( - imageUrl: i.icon!.http2https, + imageUrl: Utils.thumbnailImgUrl(i.icon!), height: 15, ), ) diff --git a/lib/pages/search_trending/view.dart b/lib/pages/search_trending/view.dart index f80a0a61..45df368b 100644 --- a/lib/pages/search_trending/view.dart +++ b/lib/pages/search_trending/view.dart @@ -5,7 +5,7 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart'; import 'package:PiliPlus/http/loading_state.dart'; import 'package:PiliPlus/models/search/search_trending/trending_list.dart'; import 'package:PiliPlus/pages/search_trending/controller.dart'; -import 'package:PiliPlus/utils/extension.dart'; +import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; @@ -200,7 +200,7 @@ class _SearchTrendingPageState extends State { if (item.icon?.isNotEmpty == true) ...[ const SizedBox(width: 4), CachedNetworkImage( - imageUrl: item.icon!.http2https, + imageUrl: Utils.thumbnailImgUrl(item.icon!), height: 16, ), ] else if (item.showLiveIcon == true) ...[ diff --git a/lib/pages/video/detail/introduction/widgets/create_fav_page.dart b/lib/pages/video/detail/introduction/widgets/create_fav_page.dart index 670c3005..f3caaafc 100644 --- a/lib/pages/video/detail/introduction/widgets/create_fav_page.dart +++ b/lib/pages/video/detail/introduction/widgets/create_fav_page.dart @@ -1,7 +1,6 @@ import 'package:PiliPlus/common/widgets/http_error.dart'; import 'package:PiliPlus/http/msg.dart'; import 'package:PiliPlus/http/user.dart'; -import 'package:PiliPlus/utils/extension.dart'; import 'package:PiliPlus/utils/utils.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:easy_debounce/easy_throttle.dart'; @@ -237,7 +236,7 @@ class _CreateFavPageState extends State { return ClipRRect( borderRadius: BorderRadius.circular(6), child: CachedNetworkImage( - imageUrl: _cover!.http2https, + imageUrl: Utils.thumbnailImgUrl(_cover!), height: constraints.maxHeight, width: constraints.maxHeight * 16 / 9, fit: BoxFit.cover, diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index d2b60069..4c9ab7fc 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -116,7 +116,7 @@ class ReplyItemGrpc extends StatelessWidget { children: [ CachedNetworkImage( height: 38, - imageUrl: replyItem.member.garbCardImage, + imageUrl: replyItem.member.garbCardImage.http2https, ), if (replyItem.member.hasGarbCardNumber()) Text( @@ -178,7 +178,8 @@ class ReplyItemGrpc extends StatelessWidget { child: CachedNetworkImage( width: 52, height: 52, - imageUrl: replyItem.member.garbPendantImage, + imageUrl: + Utils.thumbnailImgUrl(replyItem.member.garbPendantImage), ), ), ),