PageSlider 是一個輕量級的 Flutter 小部件,旨在實現水平頁面導航,非常適合引導流程或向導式介面。它允許任何自訂小部件作為可滑動頁面,提供彈性且不強制特定的 UI 風格。受到 Material Stepper 的啟發,但更具通用性,支援流暢的過渡效果和直覺的滑動手勢。非常適合在最少設定的情況下建立引導式使用者體驗。
適用情境
入門教程
向導式表單
產品導覽
互動式指南
自定義輪播圖顯示
主要特色
橫向滑動導航
支援任何小工具作為頁面
最小樣式約束
平滑過渡動畫
與現有小部件的簡單整合
適合對象
簡單的入門流程
靈活的 UI 導覽
自定義互動式內容
輕量級輪播圖需要
快速原型使用者介面序列
使用建議
無內建指示器或分頁
滾動物理效果的自定義選項有限
未針對大量頁面進行優化
需要手動處理狀態管理
最適合小型到中型內容集
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
flutter_page_slider
A simple Flutter widget that slides through pages horizontally. Use-cases could be wizards or onboarding flows similar to the Material Stepper widget, but without a particular UI - any widget can be a page to slide through.
Here's a demo of the example app:
How to use
First, create the PageSlider widget with a GlobalKey<PageSliderState> and the child widgets which you want to slide through. Then, control the active page using the global key to address the page slider state like so: