-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Design System Package import/export #141
Comments
The Themes Playground is a the moment only a tool intended to help Flutter developers that do not want to use the FlexColorScheme package API directly, to make an API configuration using the Playground as a visual and interactive API configuration tool and then copy-paste the FlexColorScheme API code for viewed configuration. The Playground was originally even just a tutorial step to show an example of how you can make an app that supports in-app dynamic theming, as done in examples 2 to 5. Example 5, is the Themes Playground app, it is built and deployed from there. Over time the Playground grew into something quite a bit more, than just a tutorial step. It is still however not the product, the package FlexColorScheme is. Due to the Playground's humble roots, it has the same very simplistic architecture as example 2, 3 and 4. If you look them, it may be a bit surprising, that you even can build a thing like the Playground, with such a simple Flutter architecture. The current architecture used in the Playground is however a bit of a roadblock for adding features that venture outside of what it does now, as it was all it was planned to do. It does for example not have a proper data model that can be conveniently converted to JSON or any other serializable format, for export or import. It just has a large bunch of individual key-value pair settings that are persisted in local storage. The storage keys and properties they impact, are internal and do not represent the FCS API, that has strict version control promises, the Playground internal settings do not have that, their implementation have changed as needed. The hand written and tuned code generation from Playground UI config props, to FlexColorScheme API output, could of course get another equivalent that would output some form of hand made JSON. As for if the DSP format referenced can be supported, I'm nor sure, perhaps. It depends on how well the FlexColorScheme API properties can be mapped to it. Anything can of course be refactored, developed and changed. Potentially a future version of the Themes Playground might even do so. More thoughts on this topic can be found here https://docs.flexcolorscheme.com/playground#future-plans More detailed requirements and ideas?I would love to get some more input one what you are looking for. What would the process be like? As I see, for it to work, I'm just spit balling here though, you would have to define theme's ColorScheme colors in FlexColorScheme, as well as the color mapping from ColorScheme to widgets/components, and other styles like border radius, elevation in the Themes Playground. Then you would export these styles and import them into Figma? To get the same in Flutter, you also copy/paste the same Playground config as API config to Flutter. You then design the app UIs in Figma using ColorScheme and component style defined in FlexColorScheme the was export from it and imported into Figma? Once you have the UI designs done in Figma you would then build the UIs in Flutter? Since the Figma design components and Flutter MaterialWidgets then share the same ColorScheme and other theme styling, the components would look the same automatically in Flutter like the Figma designs used, so they would automatically match? Is that the idea? I don’t have a clear idea of what you are looking for and how you see the process working. I only wrote down what I though, perhaps might be feasible. I don’t use use Figma or AdoebXD personally, I have only tried them casually, have not really needed them. I do plan to spend some time getting up to speed on Figma and its Material and Flutter tooling later. About the Material Theme Builder are you referring to this one? It as two variants, the web builder https://m3.material.io/theme-builder#/dynamic As far as I see they only support colors, which is simpler than including all the component/widget theming/styling as well. In addition to obvious border radius and elevation changes, FCS does a lot of nuances to Material state interactions in Flutter too. I'm not sure yet if it is possible to make a Figma plugin that support all those features, perhaps. 😄 |
You're describing exactly how it happens, you got it :) Project flow: Exporting to code:
With FlexColorScheme is part of workflow, it's not connected to design. I was thinking that importing from flex Colour Scheme into Flutter may work. But it is a slow process and creates new problems. Semantic colors Colours would be stored in JSON or Yaml. Such file can be generated in Figma or other design tool, then imported into Playground and code. While FlexColorScheme offers a lot of variety in different fantastic schemes, it's fairly rigid towards adding new ones. You can make a copy and create custom theme in it, but it rather be done in Figma or similar tool. |
Thanks @romanr for taking the time to write down this and confirming the process, plus providing additional insights into it, much appreciated. This is definitely something I would love to support and add in a more a more advanced refactored version of FlexColorScheme and Themes Playground. It would also be interesting to add a new abstraction layer on top of Flutter's theming to support a more designer friendly design system, with semantic labels, while still using native ThemeData under the hood to produce the results in a Flutter native way. The Tetrisly design system is a good example of it, thanks for the link. Current version of FlexColorScheme was mainly made to help devs use and setup the rather confusing theming in Flutter. Plus to potentially in some cases use it to help them meet exceptions passed down from designers. There is is certainly a lot of room and areas to improve when moving into design process support. Common custom approachesMost big dev shops tend to have their own design system, that they built on top of Flutter to integrate with their design process. And big "app" companies do some variation of that too, but tuned exactly for their app and brand. Sadly most that I have seen in Flutter, don't even use theming correctly and may often depend on custom component wrappers. Often using nicely semantic named const values as defaults in these wrappers, but only in rare cases to component themes, and if used, not consistently. While this works, it is has the following limitations:
FlexColorScheme 10I don't have enough time available to start working on this right now, but when I do I hope I can keep you in the loop for feedback and input, and if you want to help that is welcome too. I'm thinking here something like a FlexColorScheme 10 and Themes Playground 10. It would become a parallel track to current FCS7 (sure /8/9 if I need to break something in the API, I try not to) that would be more of a maintenance and minor feature add track. FCS10 would be almost like a fresh restart, certainly reuse parts that make sense, but probably also break things with past versions a lot, to make it much better. It would basically mostly be a new thing, but build on the recognition FlexColorScheme has managed to gather so far in the community and of course experience while making it. |
Thanks for the great library!
The missing link between design and development is ability to import and export to/from flexColorScheme.
Figma, AdobeXD, Material Theme Builder all support Design System Package (DSP) format.
Import is more difficult to implement, but if we have at least export to JSON, that will create essential link between flexColorScheme and design workflow.
I'll be glad to help with documentation or anything else.
The text was updated successfully, but these errors were encountered: