Skip to content

Commit

Permalink
[#20] [#22] Load more and refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
nmint8m committed Feb 24, 2023
1 parent 3ea0c43 commit e6efeb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/views/home/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HomeViewState extends ConsumerState<HomeView> {
height: MediaQuery.of(context).size.height,
child: Consumer(builder: (_, ref, __) {
final index = ref.watch(focusedItemIndexStream).value ?? 0;
final surveys = ref.watch(surveysStream).value ?? [];
final surveys = ref.read(surveysStream).value ?? [];
return surveys.isEmpty || index >= surveys.length
? Image(image: Assets.images.nimbleBackground.image().image)
: FadeInImage.assetNetwork(
Expand Down
2 changes: 1 addition & 1 deletion lib/views/home/survey_section/survey_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SurveyList extends StatelessWidget {
Widget _buildPullDownToRefreshPageView(BuildContext context) {
final screenWidth = MediaQuery.of(context).size.width;
itemController.addListener(() {
if (itemController.offset > screenWidth * (surveys.length - 1) + 10 &&
if (itemController.offset > screenWidth * (surveys.length - 3) + 10 &&
!_isLoading) {
_isLoading = true;
onLoadMore();
Expand Down

0 comments on commit e6efeb5

Please sign in to comment.