widgetbook 2.1.0 copy "widgetbook: ^2.1.0" to clipboard
widgetbook: ^2.1.0 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';

void main() {
  runApp(const HotreloadWidgetbook());
}

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

  @override
  Widget build(BuildContext context) {
    return Widgetbook.material(
      categories: [
        WidgetbookCategory(
          name: 'widgets',
          widgets: [
            WidgetbookComponent(
              name: 'Button',
              useCases: [
                WidgetbookUseCase(
                  name: 'elevated',
                  builder: (context) => ElevatedButton(
                    onPressed: () {},
                    child: Text(
                      context.knobs.number(
                        label: 'hello',
                      ).toString(),
                    ),
                  ),
                ),
              ],
            ),
          ],
        )
      ],
      themes: [
        WidgetbookTheme(
          name: 'Light',
          data: ThemeData.light(),
        ),
        WidgetbookTheme(
          name: 'Dark',
          data: ThemeData.dark(),
        ),
      ],
      appInfo: AppInfo(name: 'Example'),
    );
  }
}
487
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, device_frame, flutter, freezed_annotation, go_router, meta, provider, vector_math, widgetbook_models

More

Packages that depend on widgetbook