[Flutter] 34. 모두의 블로그 앱 만들기 (11) - 게시글 페이징

김주희's avatar
Jun 10, 2025
[Flutter] 34. 모두의 블로그 앱 만들기 (11) - 게시글 페이징
1페이지가 보고 싶다면 그치만 init은 () 그대로여야 함
notion image
 

Pull to Refresh

화면을 위에서 아래로 드래그해서 새로고침하는 방법

라이브러리 연결

notion image
 

post_list_body

Wrap with SmartRefresher

post_list_page가 아닌 body 내부에, 그리고 body에서도 model이 null일때는 로딩중이 돌아가는데 거기에 걸리면 터질 수 있기 때문에 null이 아닌경우에만 걸어야 한다. 그리고 refresh는 컬렉션, 리스트에만 걸 수 있으므로 List를 SmartRefresher로 감싼다.
notion image
 

onRefresh

notion image
 

onLoading

notion image
 
 
계속 돌수는 없으니까 통신 끝나고 데이터 바인딩 돼서 그림 다 그리면 도는 것도 끝나야 됨 → refreshctrl vm에서 만들어져야 됨?>
notion image
 
notion image
 
 
 
 
notion image
 

페이징

notion image
notion image
 
 

메모리 누수 잡기?

로그아웃 하면 뷰모델 살아있음 pop을 해도 autoexpose? 안돼서
다시 로그인 하면 있는 뷰모델 통신 없이 씀
그래서 모두 autodipose 잇어야 됨
특별한 경우가 아니면 (이건 나중에 앱 만들다보면 알 수 잇음)
 
처음부터 autodispose 걸 필요 없고 다 만들고 한번에 걸어도 됨
notion image
 
 
 
로그아웃 하면
notion image
notion image
 
notion image
 
 
VM이 날라가면 그 안의 객체들 날라감
notion image
 
notion image
 
Share article

jay0628