opt: pages

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-24 16:36:26 +08:00
parent 4d7d9abc60
commit c28729af5b
27 changed files with 266 additions and 310 deletions

View File

@@ -70,36 +70,37 @@ class _UpPanelState extends State<UpPanel> {
),
),
const SliverToBoxAdapter(child: SizedBox(height: 10)),
SliverList(
delegate: SliverChildListDelegate(
[
if (widget.dynamicsController.showLiveItems &&
liveList.isNotEmpty) ...[
for (int i = 0; i < liveList.length; i++) ...[
upItemBuild(liveList[i], i)
],
],
upItemBuild(UpItem(face: '', uname: '全部动态', mid: -1), 0),
upItemBuild(
UpItem(
uname: '',
face: widget.dynamicsController.face,
mid: widget.dynamicsController.ownerMid,
),
1,
),
for (int i = 0; i < upList.length; i++) ...[
upItemBuild(upList[i], i + 2)
],
],
if (widget.dynamicsController.showLiveItems && liveList.isNotEmpty)
SliverList.builder(
itemCount: liveList.length,
itemBuilder: (context, index) {
return upItemBuild(liveList[index]);
},
),
SliverToBoxAdapter(
child: upItemBuild(UpItem(face: '', uname: '全部动态', mid: -1)),
),
SliverToBoxAdapter(
child: upItemBuild(
UpItem(
uname: '',
face: widget.dynamicsController.face,
mid: widget.dynamicsController.ownerMid,
),
),
),
SliverList.builder(
itemCount: upList.length,
itemBuilder: (context, index) {
return upItemBuild(upList[index]);
},
),
const SliverToBoxAdapter(child: SizedBox(height: 200)),
],
);
}
Widget upItemBuild(data, i) {
Widget upItemBuild(data) {
bool isCurrent = widget.dynamicsController.currentMid == data.mid ||
widget.dynamicsController.currentMid == -1;
return SizedBox(