feat:重构模块

This commit is contained in:
2026-06-27 17:12:38 +08:00
parent a5e788eee6
commit a340ba424e
31 changed files with 919 additions and 623 deletions

View File

@@ -59,8 +59,8 @@ class _MomentPageState extends State<MomentPage> {
}
void _onScroll() {
// 当滚动距离超过300时显示返回顶部按钮
if (_scrollController.offset > 300) {
// 当滚动距离超过时显示返回顶部按钮
if (_scrollController.offset > 100) {
if (!_showScrollToTop) {
setState(() {
_showScrollToTop = true;
@@ -99,26 +99,38 @@ class _MomentPageState extends State<MomentPage> {
}
// 有数据时显示列表
return Stack(
children: [
buildEasyRefresh(
freshController: _freshController,
onRefresh: _onRefresh,
onLoad: _onLoad,
body: Stack(
children: [
if (provider.isLoading)
buildLoadingIndicator()
else
_buildMomentList(provider),
],
),
),
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
title: Text('朋友圈', style: Theme.of(context).textTheme.titleLarge),
centerTitle: true,
automaticallyImplyLeading: false,
),
body: Padding(
padding: EdgeInsetsGeometry.all(10),
child: Stack(
children: [
buildEasyRefresh(
freshController: _freshController,
onRefresh: _onRefresh,
onLoad: _onLoad,
body: Stack(
children: [
if (provider.isLoading)
buildLoadingIndicator()
else
_buildMomentList(provider),
],
),
),
// 返回顶部按钮
if (_showScrollToTop)
buildScrollToTop(context: context, scrollToTop: _scrollToTop),
],
// 返回顶部按钮
if (_showScrollToTop)
buildScrollToTop(context: context, scrollToTop: _scrollToTop),
],
),
),
);
}
}