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

Create CustomRefreshIndicator - edited for upgrade #246

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

thomaskim1130
Copy link
Contributor

@thomaskim1130 thomaskim1130 commented Nov 14, 2024

Overview

로딩을 위해 pull down하는 거리 감소. 편의성 증진

Changes

  • refreshIndicator.adaptive()를 ScrollNotification 클래스를 활용해 custom화 함.
  • 기존 pull down 50(변경 불가) 에서 30으로 조정. (변경 가능)
  • main_page.dart, post_list_show_page.dart, user_page.dart, post_view_page 등 페이지에 적용

Implementaion Method

  • utils/refresh_indicator.dart를 추가하여 메소드 customRefreshIndicator 생성

After Changes

  • scrollDownLength를 customize할 수 있음
  • radius, color, 애니메이션 딜레이 등도 모두 customize 가능
  • refresh 함수를 호출하는 중 중복되지 않음

Related Issues

  • LoadingIndicator(화면 중앙)와 동시에 나타나는 현상이 발생하기도 함

Rollback Scenario

  1. customRefreshIndicator 대신 refreshIndicator.adaptive 사용
  2. AlwaysScrollablePhysics의 parent 변경하기

TODO

  • user_view_page.dart 에도 적용. (DONE)
  • refreshIndicator 다수 중복. Wrapper 함수 제작? (DONE)
  • DarkMode 적용

Created new CustomRefreshIndicator that:
- doesn't rely on any global keys
- thus doesn't cause state issues
- based on actual animation + NotificationListener
- can customize radius, pull down length, offset, etc.
- based on CupertinoActionIndicator
Applied customRefreshIndicator widget to :
mainPage
notificationPage
postListShowPage
postViewPage
userPage
userViewPage

(also modified physics for android)
added back asynchronous operation
@thomaskim1130 thomaskim1130 added the enhancement New feature or request label Nov 14, 2024
@thomaskim1130 thomaskim1130 added this to the v1.3.0 milestone Nov 14, 2024
@thomaskim1130 thomaskim1130 self-assigned this Nov 14, 2024
@thomaskim1130 thomaskim1130 linked an issue Nov 15, 2024 that may be closed by this pull request
@thomaskim1130 thomaskim1130 marked this pull request as ready for review November 21, 2024 13:03
@sangohkim sangohkim requested a review from RGLie November 21, 2024 13:38
const scrollDownLength = 30.0; // refresh를 위한 최소 픽셀
const displacementLength = 0.0; // 위로부터의 default displacement
const offsetLength = 5.0; // 위/아래의 default offset
const indicatorRadius = 15.0; // 원의 default radius
Copy link
Collaborator

Choose a reason for hiding this comment

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

Flutter에서 사용하는 기본값(_kDefaultIndicatorRadius) 10.0으로 변경 부탁드립니다

Copy link
Collaborator

@sangohkim sangohkim left a comment

Choose a reason for hiding this comment

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

RefreshIndicator radius 관련한 간단한 수정 요청 드렸습니다. 시뮬레이터에서 본 결과 전체적으로 잘 동작하는것 같습니다! 안드로이드에서는 CustomRefreshIndicator만 cupertino 스타일이고 나머지는 material 디자인에 맞춰져있어서 부자연스러울 수도 있겠다는 생각이 드는데 CustomRefreshIndicator를 iOS 일 때만 적용해보는건 어떠신가요?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] CustomRefreshIndicator 적용하기
2 participants