storybook_flutter icon indicating copy to clipboard operation
storybook_flutter copied to clipboard

Feature Request : Add code snippet in Story

Open quentin7b opened this issue 3 years ago • 3 comments

First of all, thank your for this project.

It is easy to use, and nice to see.

Here is a feature request we might like for upcoming updates : Add a possibility to add a code snippet on a component Story

It would be great to see a minimum code to use to implement the demonstrated widget.

quentin7b avatar Nov 24 '21 10:11 quentin7b

I was thinking about something similar. We could provide these code snippets as md files. These could also be used with @example in the dartdoc (or we could reuse existing md files). We would then create a plugin for the storybook that uses flutter_highlight to display the code snippets.

I'm just unsure how to assign md file(s) to a story.

And this should probaly wait, until the rework of the plugin api is finished.

luvetter avatar Nov 26 '21 07:11 luvetter

Yeah, makes sense to me. I was also thinking about some code generation for snippets etc – e.g. it can be taken from the docstrings.

ookami-kb avatar Nov 27 '21 16:11 ookami-kb

Any update on this, or any instruction on how it can be added to the lib. I would gladly help on creating a PR. @ookami-kb

klevis-sp avatar Jan 10 '23 09:01 klevis-sp