Skip to content
Development tools to help you building UI on Flutter
Dart
Branch: master
Clone or download
Latest commit 10298bf Feb 24, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example Bumping version 0.0.4 Feb 24, 2020
lib
.gitignore Initial commit Dec 12, 2019
.metadata Initial commit Dec 12, 2019
CHANGELOG.md Updating changelog Feb 24, 2020
LICENSE LICENSE Dec 12, 2019
README.md
pubspec.lock Initial properties implementation Jan 4, 2020
pubspec.yaml Bumping version 0.0.4 Feb 24, 2020

README.md

Dashbook

Dashbook is a UI development tool for Flutter, it works as a development enviroment for the project widgets and also a showcase for common widgets on the app, it is heavly inspired by Storybook library, so it should be very easy for people who has already used Storybook, to use Dashbook.

It currently supports both mobile and web, having a friendly layout built to work nice on web and large resolutions.

Disclaimer: This is an early version, more features should be coming soon, suggestions, and PRs are welcome!

How to use

Add the dependency to your pubspec.ymal

dashbook: ^0.0.4

A Dashbook instance has a collection of the app widgets (Stories) and its variants (Chapters). Here you can see a very simple example of how to use it.

import 'package:flutter/material.dart';

import 'package:dashbook/dashbook.dart';

void main() {
  final dashbook = Dashbook();

  // Adds the Text widget stories
  dashbook
      .storiesOf('Text')
      // Decorators are easy ways to apply a common layout to all of the story chapters, here are using onde of Dashbook's decorators,
      // which will center all the widgets on the center of the screen
      .decorator(CenterDecorator())
      // The Widget story can have as many chapters as needed
      .add('default', (ctx) {
        return Container(width: 300, child: Text(
          ctx.textProperty("text", "Text Example"),
          textAlign: ctx.listProperty(
              "text align",
              TextAlign.center,
              TextAlign.values,
          ),
          textDirection: ctx.listProperty(
              "text direction",
              TextDirection.rtl,
              TextDirection.values,
          ),
          style: TextStyle(
              fontWeight: ctx.listProperty(
                  "font weight",
                  FontWeight.normal,
                  FontWeight.values,
              ),
              fontStyle: ctx.listProperty(
                  "font style",
                  FontStyle.normal,
                  FontStyle.values,
              ),
              fontSize: ctx.numberProperty("font size", 20)),
        ));
      });

  dashbook
      .storiesOf('RaisedButton')
      .decorator(CenterDecorator())
      .add('default', RaisedButton(child: Text('Ok'), onPressed: () {}));

  // Since dashbook is a widget itself, you can just call runApp passing it as a parameter
  runApp(dashbook);
}

Mobile example

Dashbook

Web example

Dashbook

Structure

Dashbook is just a widget, so it can be ran in any way wanted, as there is no required structure that must be followed, although, we do recommend the following approach:

  • Create a file named main_dashbook.dart on the root source of your project (e.g. lib/main_dashbook.dart)
  • Create the Dashbook instance inside that file, calling the runApp method in the end (look on the example above)
  • Run it with the command flutter run -t lib/main_dashbook.dart

Roadmap

  • Better support for themes and specific platform widgets
  • Property list for Chapters
  • Search on the stories list
  • Any other suggestions from the community
You can’t perform that action at this time.