Motivation
페이지를 이동할때 자연스럽게 스크롤 위치를 원래대로(최상단) 이동하거나 리스트의 가장 최상단으로 이동하고 싶을때
scrollController의 속성을 이용할 수 있다.
_scrollController.animateTo(
_scrollController.position.minScrollExtent,
duration: const Duration(seconds: 1),
curve: Curves.fastOutSlowIn,
);
position
- minScrollExtent : 최상단
- maxScrollExtent : 최하단
728x90
'Flutter' 카테고리의 다른 글
| [Flutter] loop list of widget (0) | 2022.04.23 |
|---|---|
| [Flutter] table 셀 너비 자동 맞춤 (0) | 2022.04.23 |
| [Flutter] swipe page to show next week data; 주간 달력 ; 옆으로 밀어서 다음주 데이터 보여주기 (0) | 2022.04.23 |
| [Flutter] api event 수신하여 table_calendar 달력 그리기 (0) | 2022.04.22 |
| [Flutter] for loop in row; Row에서 반복하여 위젯을 그리기 (0) | 2022.04.21 |