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), + ), ), ), ),