storyboard 0.0.3

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 30

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 [new 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(new MaterialApp(
      home: new Storyboard([
        new ContactsListStory(),
        new ContactsCardStory(contact: new Contact("alice")),
        new ContactsCardStory(contact: new Contact("bob")),
        new ContactsCardStory(contact: new Contact("charlie")),
  ])));
}

Or more simply, run the convenience StoryboardApp directly.

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

Further reading

See the article Storyboarding Widgets in Flutter.

[0.0.2] - 15 Mar 2018

  • Initial release.

[0.0.3] - 22 Mar 2018

  • Readme updates

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  storyboard: ^0.0.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:storyboard/storyboard.dart';
  
Version Uploaded Documentation Archive
0.0.3 Mar 22, 2018 Go to the documentation of storyboard 0.0.3 Download storyboard 0.0.3 archive
0.0.2 Mar 15, 2018 Go to the documentation of storyboard 0.0.2 Download storyboard 0.0.2 archive
0.0.1 Mar 15, 2018 Go to the documentation of storyboard 0.0.1 Download storyboard 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
36
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
60
Overall:
Weighted score of the above. [more]
30
Learn more about scoring.

We analyzed this package on Oct 18, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running flutter packages pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0-dev.5.0.flutter-4cf2d3990b.
 
 Because storyboard depends on recase ^1.0.0+1 which requires SDK version >=1.20.0 <2.0.0, version solving failed.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use storyboard.dart.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0