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

套件詳情v1.0.0

storyboard

透過將小部件與您的應用程式隔離,加速 Flutter 使用者介面的迭代開發。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
56
喜歡數
27
Pub 分數
120

安裝套件

flutter pub add storyboard

套件介紹

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

Storyboard 是一個 Flutter 套件,透過允許開發者將單一組件與主應用程式分離並獨立預覽,從而加速使用者介面的迭代開發。它支援以元件為導向的 UI 開發,讓設計、測試和優化 UI 元件變得更容易。Storyboard 支援所有主要平台——Android、iOS、Web、macOS、Windows 和 Linux,為注重一致性與快速原型設計的團隊簡化了 UI 工作流程。該套件與 Flutter 的熱重新載入無縫整合,提升設計迭代過程中的生產力。

適用情境

  • UI 組件測試
  • 快速原型設計
  • 設計系統開發
  • 協作式UI評審
  • 孤立的 widget 調試

主要特色

  • 小部件隔離
  • 即時預覽
  • 跨平台支援
  • 熱重載整合
  • 可自訂的故事檢視

適合對象

  • UI 設計師
  • 前端開發人員
  • 設計系統團隊
  • Flutter 初學者
  • 敏捷開發團隊

使用建議

  • 每個小部件都需要進行設定
  • 不適用於生產建構
  • 僅限UI導向的工作流程
  • 可能增加專案複雜性
  • 僅在開發中使用

原始 README

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

Storyboard

pub package

Faster iterative development of Flutter user interfaces by isolating widgets from your app, inspired by Storybook. Stage a collection of Widgets outside their normal app context. By repeating the same widget in various configurations or states in a single view, the effect of code changes to the Widget can quickly be assessed. This is especially useful for cosmetic changes, but also effective for behavior changes.

Adding Stories

The first step is to build a few stories, from which your Storyboard will be composed. Building stories is done by providing concrete children of the Story abstract class, e.g.

import 'package:mypackage/contacts.dart';
import 'package:storyboard/storyboard.dart';

class ContactsListStory extends Story {

  @override
  List<Widget> get storyContent {
    return [ContactsList()];
  }
}

At a minimum, the abstract storyContent getter, which provides the widgets to be observed, must be overridden. Overriding the title will alter the heading presented for the story. Overriding isFullScreen (or implementing FullScreenStory) will instruct the Widget to render itself within a new Navigator route without scaffolding.

The build method itself can also be overridden to completely customize the display of the Story.

Building a Storyboard

A storyboard is little more than a collection of stories.

import 'package:flutter/material.dart';
import 'package:storyboard/storyboard.dart';
import 'stories/contacts_story.dart';

void main() {
  runApp(MaterialApp(
      home: Storyboard([
        ContactsListStory(),
        ContactsCardStory(contact: Contact("alice")),
        ContactsCardStory(contact: Contact("bob")),
        ContactsCardStory(contact: Contact("charlie")),
  ])));
}

Or more simply, run the convenience StoryboardApp directly.

void main() {
  runApp(StoryboardApp([
    ContactsListStory(),
    ContactsCardStory(contact: Contact("alice")),
    ContactsCardStory(contact: Contact("bob")),
    ContactsCardStory(contact: Contact("charlie")),
  ]));
}

Further reading

See the article Storyboarding Widgets in Flutter.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。