搜尋套件、儲存庫與 APP 分類

套件詳情v0.1.9

flutterbook

一個用於加速 Flutter widget 開發的劇情板工具。

AndroidiOSmacOSWindowsLinux
近 30 天下載
181
喜歡數
42
Pub 分數
130

安裝套件

flutter pub add flutterbook

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

FlutterBook 是一個故事板工具,專為加速 Flutter 組件的開發而設計,透過支援元件驅動的 UI 設計。它讓開發者與設計師能夠在獨立環境中視覺化、測試與迭代單一組件,並在多個平台實時預覽。專為快速原型設計打造,支援於視覺化介面中進行動態設定與狀態管理。該工具可透過簡單的 pub add 命令無縫整合至 Flutter 工作流程,且為開源專案,鼓勵社群貢獻。適合注重一致性與可重複使用 UI 元件的團隊。

適用情境

  • 快速UI原型設計
  • 組件庫開發
  • 跨平台 widget 測試
  • 設計系統實作
  • 協作式UI評審

主要特色

  • 跨平台即時預覽
  • 互動式 widget 設定
  • 支援多種裝置尺寸
  • 內建狀態管理
  • 開源且可擴展

適合對象

  • 使用 Flutter 的 UI/UX 設計師
  • 建構可重複使用元件的前端開發人員
  • 使用設計系統的團隊
  • 產品團隊正在迭代UI原型
  • 尋求更快反饋循環的開發者

使用建議

  • 需要整合到現有的 Flutter 專案中
  • 限制為小部件級別的可視化
  • 不是像 Figma 那樣的完整設計工具
  • 最適合元件導向的工作流程
  • 可能需要為複雜狀態進行額外設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutterbook

Flutterbook

A storyboarding tool to accelerate the development of Flutter widgets. Inspired by Storybook.js.

The package is built to support Windows and Web layouts. There is no support for mobile support at the moment. This is new and still under heavy development, expect many changes to occur with usage.

License: MIT


Go subscribe to my YouTube channel to support development.

MOONSDONTBURN Header

Demo

Demo Link Here

Overview ✨

Creating the Main

Start by creating the storyboard widget. This will wrap the Flutterbook widget so that when it is edited, it will hot reload.

class Storyboard extends StatelessWidget {
  const Storyboard({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return FlutterBook(
      categories: [
          // organizers ...
      ],
    );
  }
}

After creating the Storyboard widget, you can run it by using the main. I recommend making another file named main_storyboard.dart to maintain your storyboard.

void main() {
  runApp(const Storyboard());
}
// Or run it directly, but this will cost the hot reload.
// void main() {
//   runApp(const Flutterbook(categories:[...]));
// }
How to add Widgets

To add widgets, you simply put Organizers, aka Category, Folder, Component, and ComponentState.

The hierarchy goes

Category > Folder > Component > ComponentState

but you may also do

Category > Component > ComponentState

or

Category > Folder > Folder > Component > ComponentState

Here is a complex example of a single Category. In the example, we use the builder where we are able to access different controls.

Category(
    categoryName: 'LIBRARY',
    organizers: [
    Folder(
        folderName: 'Charts',
        organizers: [
        Component(
            componentName: 'LineGraph',
            states: [
            ComponentState.child(
                stateName: 'Default Container',
                child: Container(),
            ),
            ],
        ),
        ],
    ),
    Component(
        componentName: 'Button',
        compenentMarkdoown: """##A global button component""",
        states: [
        ComponentState(
            stateName: 'Primary',
            markdown: """Used for the main action to be performed"""
            codeSample:  r'''
Button.primary(
  child: Text('Primary Button'),
  onPressed: () {},
);
'''
            builder: (context, c) {
            return Center(
                child: SizedBox(
                width: c.number(
                    label: 'Number',
                    initial: 50,
                    min: 50,
                    max: 250,
                ),
                height: c.number(
                    label: 'height',
                    initial: 50,
                    min: 50,
                    max: 250,
                    description: 'random stuff',
                ),
                child: CupertinoButton.filled(
                    onPressed: c.boolean(
                    label: 'boolean',
                    initial: true,
                    )
                        ? () {}
                        : null,
                    child: Text(
                    c.text(label: 'Text', initial: 'Hello World'),
                    ),
                ),
                ),
            );
            },
        ),
        ],
    ),
    ],
),
That's it!

Roadmap 🚧

  • [ ] Mobile Support
  • [ ] 100% Code Coverage Testing
  • [X ] Documentation Support in ComponentState's
  • [ ] Better Docs
  • [X ] Device Previews
  • [ ] Shareable Handoffs
  • [ ] Optimization

Contributors 🔥

Your name could be here 😉

所屬分類

依賴

依賴清單 8 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。