widgetbook 1.0.0-beta.1 copy "widgetbook: ^1.0.0-beta.1" to clipboard
widgetbook: ^1.0.0-beta.1 copied to clipboard

outdated

A flutter storybook that helps professionals and teams to catalogue their widgets.

example/main.dart

import 'package:flutter/material.dart';
import 'package:widgetbook/widgetbook.dart';

class CustomWidget extends StatelessWidget {
  const CustomWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.green,
      child: const Text('hello world'),
    );
  }
}

class HotReload extends StatelessWidget {
  const HotReload({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Widgetbook(
      categories: [
        WidgetbookCategory(
          name: 'widgets',
          widgets: [
            WidgetbookWidget(
              name: '$CustomWidget',
              stories: [
                WidgetbookUseCase(
                  name: 'Default',
                  builder: (context) => const CustomWidget(),
                ),
              ],
            ),
          ],
          folders: [
            WidgetbookFolder(
              name: 'Texts',
              widgets: [
                WidgetbookWidget(
                  name: 'Normal Text',
                  stories: [
                    WidgetbookUseCase(
                      name: 'Default',
                      builder: (context) => const Text(
                        'The brown fox ...',
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ],
        ),
      ],
      appInfo: AppInfo(
        name: 'Widgetbook Example',
      ),
    );
  }
}

void main() {
  runApp(const HotReload());
}
537
likes
0
pub points
97%
popularity

Publisher

verified publisherwidgetbook.io

A flutter storybook that helps professionals and teams to catalogue their widgets.

Homepage
Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

collection, flutter, flutter_web_plugins, meta, vector_math, widgetbook_models

More

Packages that depend on widgetbook