From 5c6b8624d71821c67142b5a76507204cffd9ec53 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sat, 21 Oct 2023 23:01:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E5=B7=B2=E5=85=B3=E6=B3=A8up?= =?UTF-8?q?=E5=88=86=E7=BB=84=20issues=20#203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/follow/widgets/follow_item.dart | 25 ++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/pages/follow/widgets/follow_item.dart b/lib/pages/follow/widgets/follow_item.dart index cae72f4c..d367b8d4 100644 --- a/lib/pages/follow/widgets/follow_item.dart +++ b/lib/pages/follow/widgets/follow_item.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/models/follow/result.dart'; +import 'package:pilipala/pages/video/detail/introduction/widgets/group_panel.dart'; import 'package:pilipala/utils/feed_back.dart'; import 'package:pilipala/utils/utils.dart'; @@ -39,7 +41,28 @@ class FollowItem extends StatelessWidget { overflow: TextOverflow.ellipsis, ), dense: true, - trailing: const SizedBox(width: 6), + trailing: SizedBox( + height: 34, + child: TextButton( + onPressed: () async { + await Get.bottomSheet( + GroupPanel(mid: item.mid!), + isScrollControlled: true, + ); + SmartDialog.showToast('重进页面查看效果'); + }, + style: TextButton.styleFrom( + padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), + foregroundColor: Theme.of(context).colorScheme.outline, + backgroundColor: + Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色 + ), + child: const Text( + '已关注', + style: TextStyle(fontSize: 12), + ), + ), + ), ); } } From 445a37d305e925adb2bd22e2c674d692e8d417a2 Mon Sep 17 00:00:00 2001 From: guozhigq Date: Sun, 22 Oct 2023 10:32:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?mod:=20=E9=A6=96=E9=A1=B5=E5=A4=9A=E5=88=97?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9B=B4=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/bangumi/view.dart | 2 +- lib/pages/live/view.dart | 24 ++---------------------- lib/pages/rcmd/view.dart | 22 +++++++++++++++------- 3 files changed, 18 insertions(+), 30 deletions(-) diff --git a/lib/pages/bangumi/view.dart b/lib/pages/bangumi/view.dart index 78d4a2a9..e48715eb 100644 --- a/lib/pages/bangumi/view.dart +++ b/lib/pages/bangumi/view.dart @@ -201,7 +201,7 @@ class _BangumiPageState extends State }, ), ), - const LoadingMore() + LoadingMore() ], ), ); diff --git a/lib/pages/live/view.dart b/lib/pages/live/view.dart index fc29dea7..1fbff63c 100644 --- a/lib/pages/live/view.dart +++ b/lib/pages/live/view.dart @@ -10,6 +10,7 @@ import 'package:pilipala/common/widgets/animated_dialog.dart'; import 'package:pilipala/common/widgets/http_error.dart'; import 'package:pilipala/common/widgets/overlay_pop.dart'; import 'package:pilipala/pages/main/index.dart'; +import 'package:pilipala/pages/rcmd/index.dart'; import 'controller.dart'; import 'widgets/live_item.dart'; @@ -118,7 +119,7 @@ class _LivePageState extends State }, ), ), - const LoadingMore() + LoadingMore(ctr: _liveController) ], ), ), @@ -180,24 +181,3 @@ class _LivePageState extends State ); } } - -class LoadingMore extends StatelessWidget { - const LoadingMore({super.key}); - - @override - Widget build(BuildContext context) { - return SliverToBoxAdapter( - child: Container( - height: MediaQuery.of(context).padding.bottom + 80, - padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), - child: Center( - child: Text( - '加载中...', - style: TextStyle( - color: Theme.of(context).colorScheme.outline, fontSize: 13), - ), - ), - ), - ); - } -} diff --git a/lib/pages/rcmd/view.dart b/lib/pages/rcmd/view.dart index 165613a6..51771d3c 100644 --- a/lib/pages/rcmd/view.dart +++ b/lib/pages/rcmd/view.dart @@ -125,7 +125,7 @@ class _RcmdPageState extends State }, ), ), - const LoadingMore() + LoadingMore(ctr: _rcmdController) ], ), ), @@ -191,7 +191,8 @@ class _RcmdPageState extends State } class LoadingMore extends StatelessWidget { - const LoadingMore({super.key}); + dynamic ctr; + LoadingMore({super.key, this.ctr}); @override Widget build(BuildContext context) { @@ -199,11 +200,18 @@ class LoadingMore extends StatelessWidget { child: Container( height: MediaQuery.of(context).padding.bottom + 80, padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), - child: Center( - child: Text( - '加载中...', - style: TextStyle( - color: Theme.of(context).colorScheme.outline, fontSize: 13), + child: GestureDetector( + onTap: () { + if (ctr != null) { + ctr!.onLoad(); + } + }, + child: Center( + child: Text( + '加载更多 👇', + style: TextStyle( + color: Theme.of(context).colorScheme.outline, fontSize: 13), + ), ), ), ),