Comments (12)
Hey, I made this private because all the built-in knobs are available through methods like boolean
, text
etc. External knobs would break this convention. Still, a good idea to think about.
At the same time, color picker seems like a commonly used knob, it would be good to have it out of the box, so feel free to add this as a PR into the library itself.
from storybook_flutter.
@Maatteogekko , Thanks for reviewing the PR. i created this knob in the case of user defined color options only. Going forward i am thinking to open a PR for a separate color palette knob for per-defined color options using a color picker. @ookami-kb Please help review & approve the PR. thanks!
from storybook_flutter.
While I think it can be a good idea for the core library, I still think you should open the _addKnob
method. I can still think of other potential additions to the knobs which are pretty project specific.
Since everything else tries to be pluggable, this should as well.
from storybook_flutter.
added a PR for color knob with preview - color knob support
from storybook_flutter.
@divyanshuk10 I took a look at the PR. I was thinking more about showing a color wheel and letting the user pick the color on the fly, and possibly specifying a predefined list of colors to choose from.
Something like this package (minus all the cosmetic options, and embedded in the side panel)
from storybook_flutter.
I agree with @Maatteogekko that color picker makes more sense in the context of the color knob. The list of predefined colors is just a select knob with custom renderer of the list tile. If it's needed, it's better to add support for this custom renderer to the select knob.
from storybook_flutter.
Hey @ookami-kb
I still think that opening _addKnob
would be a cool addition. I just tried to add a button knob by myself, just as a plugin / extension because it serves a pretty special usecase. However, without having access to the _addKnob
method, I do not have any chance to add something.
Even when opening this add knob method, the convention still holds since people can just write extensions:
extension CustomKnobs on KnobsNotifier {
ButtonKnobValue button(
{required String label, String? description, bool enabled = true}) =>
throw UnimplementedError();
}
It would be cool to have this, such that custom knobs can be implemented and even shared (thinking #52 and the color knob).
Cheers
from storybook_flutter.
Hey, yeah, that makes sense. But the button looks like a valid core functionality, we should add it to the library itself. Would it be enough for your use case?
from storybook_flutter.
Hey @ookami-kb, should I make a PR to open up _addKnob?
It would be the most open addition to truly customize flutter storybook 😊
from storybook_flutter.
Hey @buehler, yep, go ahead 👍
from storybook_flutter.
Done in #130
from storybook_flutter.
Thanks for #130 I think making KnobListTile
public would also be useful, otherwise any custom knob you add is not styled correctly.
from storybook_flutter.
Related Issues (20)
- Missing routes for stories HOT 2
- Text knobs keeps state of previous story
- Exception inside search text field HOT 3
- Working with AutoRouter6
- Request new feature: Capture screenshot for submit appstore/googleplay HOT 1
- Feature Request: Add device with 320px width HOT 2
- FR: knobs.sliderInt divisions should default to (max-min) HOT 1
- Support for themes HOT 4
- "Could not find the correct Provider..." when the DevTools is open HOT 1
- TapUpDetais.globalPosition is incorrect HOT 1
- Hot-reload causes Story (and thus widgets) to be rebuilt / reinitialised HOT 1
- Option to remove LayoutPlugin HOT 3
- Strange "flickering" underneath the story selector
- How to set default device frame HOT 1
- How do I see the showcase? HOT 3
- Story content picker and knobs covered by keyboard on mobile view HOT 3
- Change menu font family HOT 4
- Publish new version HOT 1
- The getter 'knobs' isn't defined for the type 'BuildContext'. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from storybook_flutter.