Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#17] [Integrate] As a logged-in user, I can scroll to load more surveys #71

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

nkhanh44
Copy link
Collaborator

@nkhanh44 nkhanh44 commented Aug 30, 2023

What happened 👀

  • Make HomePagesWidget Stateful.
  • Implemented Load More feature for the home screen.
  • Restructure the home view model and home pages widget.
  • Fixed the issue about refreshing to jump back to the first page.
  • Unit tests are already covered.

Insight 📝

  • Note: There's an issue when scroll to the end, the length of pages indicator stacked up to many until it comes back to normal length. It may need a loading state or something like that, but I will address it later 🙏 .
  • In home view model, I separated 2 cases, and for the case not found error, it's used for when we reach the last page and no more content. We can complete this detecting by using the records params in Meta, but for now I will keep it as it is.
  void _handleError(Failed result) {
    if (result.isNotFoundError()) {
      _surveys.add(_loadedSurveys);
      state = const HomeState.loadSurveysSuccess(false);
    } else {
      _error.add(result.getErrorMessage());
      state = const HomeState.error();
    }
  }

Proof Of Work 📹

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-08-30.at.09.10.01.mp4

@nkhanh44 nkhanh44 added this to the 0.5.0 milestone Aug 30, 2023
@nkhanh44 nkhanh44 self-assigned this Aug 30, 2023
@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Patch coverage: 88.88% and project coverage change: +1.05% 🎉

Comparison is base (492d7fe) 48.43% compared to head (0f3a00b) 49.49%.
Report is 6 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #71      +/-   ##
===========================================
+ Coverage    48.43%   49.49%   +1.05%     
===========================================
  Files           36       36              
  Lines          384      396      +12     
===========================================
+ Hits           186      196      +10     
- Misses         198      200       +2     
Flag Coverage Δ
unittests 49.49% <88.88%> (+1.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib/screens/home/home_view_model.dart 94.59% <87.50%> (-5.41%) ⬇️
lib/usecases/base/use_case_result.dart 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nkhanh44 nkhanh44 force-pushed the feature/17-scroll-to-load-more-surveys branch 2 times, most recently from b8a8fcd to 3ca32ec Compare August 30, 2023 03:41
@nkhanh44 nkhanh44 force-pushed the feature/17-scroll-to-load-more-surveys branch from 3ca32ec to 0ae502c Compare August 30, 2023 03:47
@nkhanh44 nkhanh44 marked this pull request as ready for review August 30, 2023 03:50
Copy link

@doannimble doannimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest lgtm

lib/screens/home/home_screen.dart Outdated Show resolved Hide resolved
lib/screens/home/home_screen.dart Outdated Show resolved Hide resolved
@nkhanh44 nkhanh44 force-pushed the feature/17-scroll-to-load-more-surveys branch from 5224dcd to 0f3a00b Compare August 31, 2023 06:49
Copy link
Collaborator

@Thieurom Thieurom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Copy link

@doannimble doannimble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good now 🏃‍♂️

@nkhanh44 nkhanh44 merged commit fa5e5e6 into develop Aug 31, 2023
4 checks passed
@nkhanh44 nkhanh44 deleted the feature/17-scroll-to-load-more-surveys branch August 31, 2023 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Integrate] As a logged-in user, I can scroll to load more surveys
3 participants