diff --git a/lib/models_new/live/live_feed_index/card_data_item.dart b/lib/models_new/live/live_feed_index/card_data_item.dart index eff104eb7..740a3c76c 100644 --- a/lib/models_new/live/live_feed_index/card_data_item.dart +++ b/lib/models_new/live/live_feed_index/card_data_item.dart @@ -2,12 +2,10 @@ import 'package:PiliPlus/models_new/live/live_feed_index/card_data_list_item.dar class CardDataItem { List? list; - dynamic topView; ExtraInfo? extraInfo; CardDataItem({ this.list, - this.topView, this.extraInfo, }); @@ -15,7 +13,6 @@ class CardDataItem { list: (json['list'] as List?) ?.map((e) => CardLiveItem.fromJson(e as Map)) .toList(), - topView: json['top_view'] as dynamic, extraInfo: json['extra_info'] == null ? null : ExtraInfo.fromJson(json['extra_info'] as Map), diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index 96313f65d..2b83b1046 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -255,19 +255,20 @@ class _LivePageState extends CommonPageState } List _buildFollowList(ThemeData theme, LiveCardList item) { + final totalCount = item.cardData?.myIdolV1?.extraInfo?.totalCount ?? 0; return [ SliverToBoxAdapter( child: Padding( padding: const .only(bottom: 8.0), child: Row( + mainAxisAlignment: .spaceBetween, children: [ Text.rich( TextSpan( children: [ const TextSpan(text: '我的关注 '), TextSpan( - text: - '${item.cardData?.myIdolV1?.extraInfo?.totalCount ?? 0}', + text: totalCount.toString(), style: TextStyle( fontSize: 13, color: theme.colorScheme.primary, @@ -283,7 +284,6 @@ class _LivePageState extends CommonPageState ], ), ), - const Spacer(), moreTextButton( onTap: () => Get.to(const LiveFollowPage()), color: theme.colorScheme.outline, @@ -293,11 +293,16 @@ class _LivePageState extends CommonPageState ), ), if (item.cardData?.myIdolV1?.list case final list?) - if (list.isNotEmpty) _buildFollowBody(theme, list), + if (list.isNotEmpty) _buildFollowBody(theme, list, totalCount), ]; } - Widget _buildFollowBody(ThemeData theme, List followList) { + Widget _buildFollowBody( + ThemeData theme, + List followList, + int totalCount, + ) { + final listLength = followList.length; return SliverToBoxAdapter( child: SizedBox( // 3+4+45+6+10+12*textScaler @@ -308,8 +313,28 @@ class _LivePageState extends CommonPageState slivers: [ SliverFixedExtentList.builder( itemExtent: 70, - itemCount: followList.length, + itemCount: totalCount > listLength ? listLength + 1 : listLength, itemBuilder: (context, index) { + if (index == listLength) { + return Align( + alignment: const Alignment(0, -0.3), + child: GestureDetector( + onTap: () => Get.to(const LiveFollowPage()), + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + shape: .circle, + color: theme.colorScheme.onInverseSurface, + ), + child: Icon( + Icons.keyboard_arrow_right, + color: theme.colorScheme.onSurfaceVariant, + ), + ), + ), + ); + } final item = followList[index]; return Padding( padding: const .only(right: 5),