Skip to content

Instantly share code, notes, and snippets.

@AlenaNicolay
Created July 14, 2023 12:58
Show Gist options
  • Save AlenaNicolay/75c7a4b3cda8e5e57830c672be4846fc to your computer and use it in GitHub Desktop.
Save AlenaNicolay/75c7a4b3cda8e5e57830c672be4846fc to your computer and use it in GitHub Desktop.
Widgetbook use case with knobs
@widgetbook.UseCase(
name: 'Customizable',
type: CustomButton,
)
CustomButton customizableButton(BuildContext context) {
return CustomButton(
title: context.knobs.string(label: 'Title', initialValue: 'Click Me'),
onPressed: context.knobs.boolean(label: 'Enabled', initialValue: true)
? () {}
: null,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment