🐛 Fix post shuffle
This commit is contained in:
@@ -36,9 +36,11 @@ class PostShuffleScreen extends HookConsumerWidget {
|
|||||||
bottom:
|
bottom:
|
||||||
kBottomControlHeight + MediaQuery.of(context).padding.bottom,
|
kBottomControlHeight + MediaQuery.of(context).padding.bottom,
|
||||||
),
|
),
|
||||||
child:
|
child: Builder(
|
||||||
(postListState.value?.items.length ?? 0) > 0
|
key: ValueKey(postListState.value?.items.length ?? 0),
|
||||||
? CardSwiper(
|
builder: (context) {
|
||||||
|
if ((postListState.value?.items.length ?? 0) > 0) {
|
||||||
|
return CardSwiper(
|
||||||
controller: cardSwiperController,
|
controller: cardSwiperController,
|
||||||
cardsCount: postListState.value!.items.length,
|
cardsCount: postListState.value!.items.length,
|
||||||
isLoop: false,
|
isLoop: false,
|
||||||
@@ -67,15 +69,17 @@ class PostShuffleScreen extends HookConsumerWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
onEnd: () {
|
onEnd: () async {
|
||||||
if (postListState.value?.hasMore ?? true) {
|
if (postListState.value?.hasMore ?? true) {
|
||||||
postListNotifier.fetch(
|
postListNotifier.forceRefresh();
|
||||||
cursor: postListState.value?.nextCursor,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
: Center(child: CircularProgressIndicator()),
|
} else {
|
||||||
|
return Center(child: CircularProgressIndicator());
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
|
Reference in New Issue
Block a user