dashbook 0.0.12 copy "dashbook: ^0.0.12" to clipboard
dashbook: ^0.0.12 copied to clipboard

outdated

A showcase/sandbox library to help you build isolated widgets in Flutter

example/lib/main.dart

import 'package:example/text_story.dart';
import 'package:flutter/material.dart';

import 'package:dashbook/dashbook.dart';

void main() {
  final dashbook = Dashbook.dualTheme(
    light: ThemeData(),
    dark: ThemeData.dark(),
    title: 'Dashbook Example',
  );

  addTextStories(dashbook);

  dashbook.storiesOf('ElevatedButton').decorator(CenterDecorator()).add(
        'default',
        (ctx) => ElevatedButton(
          child: Text(
            ctx.listProperty("Label", "Ok", ["Ok", "Cancel", "Other label"]),
            style: TextStyle(
              fontSize: ctx.numberProperty("font size", 20),
            ),
          ),
          onPressed: () {},
        ),
      );

  dashbook.storiesOf('Checkbox').decorator(CenterDecorator()).add(
        'default',
        (ctx) => Checkbox(
          value: ctx.boolProperty("checked", true),
          onChanged: (_) {},
        ),
      );

  dashbook.storiesOf('Container').decorator(CenterDecorator()).add(
        'default',
        (ctx) => Container(
          color: Colors.blue[300],
          width: 300,
          height: 300,
        ),
      )
        ..add(
            'with padding',
            (ctx) => Container(
                  color: Colors.blue[300],
                  width: 300,
                  height: 300,
                  padding: ctx.edgeInsetsProperty(
                    "edge Insets",
                    EdgeInsets.fromLTRB(30, 10, 30, 50),
                  ),
                  child: Container(color: Colors.green),
                ))
        ..add(
            'with border radius',
            (ctx) => Container(
                  width: 300,
                  height: 300,
                  decoration: BoxDecoration(
                    color: Colors.blue[300],
                    borderRadius: ctx.borderRadiusProperty(
                        "border radius",
                        BorderRadius.only(
                            topLeft: Radius.circular(10),
                            topRight: Radius.circular(10),
                            bottomLeft: Radius.circular(50),
                            bottomRight: Radius.circular(50))),
                  ),
                ));

  runApp(dashbook);
}
114
likes
0
pub points
91%
popularity

Publisher

verified publisherblue-fire.xyz

A showcase/sandbox library to help you build isolated widgets in Flutter

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_colorpicker, url_launcher

More

Packages that depend on dashbook