opt: load more

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-27 12:42:27 +08:00
parent 05f9384c72
commit 4a145750c0
12 changed files with 65 additions and 156 deletions

View File

@@ -4,6 +4,7 @@ import 'package:PiliPalaX/common/widgets/article_content.dart';
import 'package:PiliPalaX/common/widgets/http_error.dart';
import 'package:PiliPalaX/http/loading_state.dart';
import 'package:PiliPalaX/pages/video/detail/reply/widgets/reply_item_grpc.dart';
import 'package:PiliPalaX/utils/extension.dart';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
@@ -334,18 +335,19 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
itemBuilder: (context, index) {
if (index == loadingState.response.replies.length) {
return Container(
alignment: Alignment.center,
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom),
height: MediaQuery.of(context).padding.bottom + 100,
child: Center(
child: Obx(
() => Text(
_htmlRenderCtr.noMore.value,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.outline,
),
),
child: Text(
_htmlRenderCtr.isEnd.not
? '加载中...'
: loadingState.response.replies.isEmpty
? '还没有评论'
: '没有更多了',
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.outline,
),
),
);