搜索插件、代码仓与 APP 分类

插件详情v0.1.9

flutterbook

一个用于加速 Flutter widget 开发的故事情节工具。

AndroidiOSmacOSWindowsLinux
近 30 天下载
235
喜欢数
42
Pub 分数
130

安装插件

flutter pub add flutterbook

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

FlutterBook 是一个故事板工具,旨在通过支持组件驱动的UI设计来加速Flutter组件的开发。它允许开发者和设计师在独立环境中可视化、测试和迭代单个组件,并在多个平台上实现实时预览。专为快速原型设计而打造,支持在可视化界面中进行动态配置和状态管理。该工具可通过简单的 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 项

源码仓库

使用此插件的项目

暂无相关数据。