dashbook icon indicating copy to clipboard operation
dashbook copied to clipboard

Change Preview Tab to include Widget with Code View

Open chimon2000 opened this issue 3 years ago • 6 comments

We have actually started using this and feel like it's a nice feature to bake into dashbook.

Poached from flutter_catelog. It allows developers to view a preview of the widget but then also see the source code for that widget.

Here is the library that we are currently using in tandem with dashbook.

chimon2000 avatar Jan 25 '21 17:01 chimon2000

Dashbook kind of support something similar to that already, you can provide a codelink property when adding the chapter and it will create an icon to top of the page, you can check it working here: https://flame-engine.github.io/flame_example/#/

I think the only difference from what you are suggestion is that it would should the code directly on the page? Maybe on an iframe or webview?

erickzanardo avatar Jan 25 '21 18:01 erickzanardo

Yup, that's the only major difference, with the ability to copy the code directly. I can put together a working example if needed.

chimon2000 avatar Jan 26 '21 06:01 chimon2000

I've created a custom decorator with the package widget_with_codeview.

It's very simple.. Just need to add an IconButton to show/hide the code...

emersonsiega avatar Jun 24 '21 11:06 emersonsiega

wow, that is such a simple solution! I will try adding something similar on Dashbook

erickzanardo avatar Jun 24 '21 12:06 erickzanardo

@erickzanardo wondering if this is something you're still looking to add.

chimon2000 avatar Jun 15 '22 16:06 chimon2000

Hey @chimon2000 ! Yes, definitely, but I am failing to find time to work on that, would you have interest in trying to submit a PR for this? I could try guiding you in case you need assistance.

erickzanardo avatar Jun 15 '22 21:06 erickzanardo