Flow Builder 是一個 Flutter 套件,透過靈活的宣告式 API 簡化應用流程的建立與管理。它讓開發者能以乾淨、易讀的方式定義複雜的導航序列與狀態轉換,減少重複程式碼。非常適合管理多步驟流程,例如引導流程、結帳流程或精靈流程,促進可維護且可擴展的流程邏輯。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux。
適用情境
入門流程
結帳流程
多步驟向導
有狀態導航
複雜的路由邏輯
主要特色
宣告式流程定義
最小化樣板
狀態管理整合
跨平台支援
靈活的過渡處理
適合對象
開發複雜導航的開發者
注重程式碼整潔的團隊
具有多步驟用戶旅程的項目
需要動態流控制的應用程式
使用建議
需要理解狀態管理
最適合具有清晰過渡的流程
可能會為簡單導航增加開銷
不是核心導航器的替代品
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
Flutter Flows made easy!
Usage
Define a Flow State
The flow state will be the state which drives the flow. Each time this state changes, a new navigation stack will be generated based on the new flow state.
FlowBuilder is a widget which builds a navigation stack in response to changes in the flow state. onGeneratePages will be invoked for each state change and must return the new navigation stack as a list of pages.