-
<Flutter> PageController class액티브 스킬/플러터 2022. 6. 23. 21:14728x90
🎯⚡🕊️
PageView
플러터에서는 페이지 스크롤(스와이프)을 구현하기 위해 PageView 위젯을 사용합니다.
PageView 위젯은 controller, children 2가지 인자를 기본적으로 사용합니다.
(scrollDirection, reverse 등과 같은 매개변수를 통해 스크롤의 성질을 설정할 수도 있음)
children 매개변수에는 예상하듯이 스크롤이 필요한 페이지들을 인자로 대입합니다.
controller에는 PageController 인스턴스를 대입하게 됩니다.
PageController
PageController 인스턴스를 통해서 페이지 이동을 컨트롤할 수 있습니다.
initialPage와 같은 프로퍼티를 통해서 PageView의 children 중에서 사용자에게 처음으로 노출될 페이지를 설정합니다.
animateToPage 같은 메서드는 페이지 전환시 애니메이션을 추가하는 기능을 합니다.
📌
https://api.flutter.dev/flutter/widgets/PageView-class.html
PageView class - widgets library - Dart API
A scrollable list that works page by page. Each child of a page view is forced to be the same size as the viewport. You can use a PageController to control which page is visible in the view. In addition to being able to control the pixel offset of the cont
api.flutter.dev
https://api.flutter.dev/flutter/widgets/PageController-class.html
PageController class - widgets library - Dart API
A controller for PageView. A page controller lets you manipulate which page is visible in a PageView. In addition to being able to control the pixel offset of the content inside the PageView, a PageController also lets you control the offset in terms of pa
api.flutter.dev
728x90'액티브 스킬 > 플러터' 카테고리의 다른 글
<Flutter> VS Code Java 버전 수정 (0) 2022.06.24 <Flutter> BottomNavigationBar 라벨 지우기 (0) 2022.06.24 <Flutter> 플러터 위젯 튜토리얼 (응용) - 제임쓰 Dev (2) 2021.07.26 <Flutter> 플러터 위젯 튜토리얼 (Scaffold) - 제임쓰 Dev (0) 2021.07.25 <Flutter> Flutter 2.0 (0) 2021.03.07