-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Playground theme import / export. #257
Playground theme import / export. #257
Conversation
…perty we want to use.
…de in the exported data.
Thanks a lot @akiller! Awesome contribution, much appreciated and I'm sure Playground users will love it too. I removed the version info pkg, mostly because it cannot handle versions with "-" in it like the one in the dev releases on iOS etc. There is a very simple manually maintained Fix some linter nits, I use super strict linting settings. With this feature I can add some really cool "integration" like tests to the Playground app, curious to try it out later as well. |
Sounds great, and no problem.
Oh oops!
Heh I did try and clear up most of the vscode linter errors. Personally I'm a renegade who likes using var 😊. |
Naah, all good @akiller! 😄 So for info. I did some other minor tuning to the feature. I think it is a bit safer not having a TextField for copy paste, since you can edit and change it by mistake. So I made a staging area where you can only see see what is going in/out and added some own buttons to copy/paste it. Plus it now skips exporting values that are null in the storage. A long time ago there where cases where a lack of key of course meant use default value, but sometimes when values were nullable, null was not the default value for the key, so I needed to store null value as another setting than the default, that was maybe not null. That is still there and the playground stores "null" settings values too, instead of assuming it is the default. Null has meaning in theming in Flutter and often produces different results in M2 and M3 mode, as they have different null default results in the framework. But nowadays props in Playground are all null by default too, so we can skip all those too in the export, makes it cleaner. Also since it is in theory possible to edit and maybe get crap into the storage there is an option to nuke it too. If you nuke it, and export, you get a file with nothing, but that still loads the correct default Playground settings corresponding to it. I also cleaned up and changed a lot of the storage keys to make them more descriptive (and always sync names with controller props too). This is breaking release and it is also the first time this features exists so, I can change the storage key now to whatever, there is not going to be any option to keep and use settings from a V7 local storage anyway. Then I got paranoid and added valid key checking to imports too (plus some size limits). To do this, I made a python script that extracts all the keys from the store.dart file and I put them in a list and just check import keys against it, and skip things that are not valid. A bit of schema checking. Before you could add whatever keys to the imported JSON and get them imported into the storage and thrown out again when you exported it, not so nice. So that should not be as easily possible anymore. Still since there is no back-end, all you could muck up is your own local storage, so maybe not so critical, but it is there now anyway. Going to release a 8.0.0-dev.2 version and build soonish, so people can test it out. Screen.Recording.2024-10-22.at.21.56.00.mov |
Oh that's looking really good, you've definitely put the finishing touches it needed into it. It will be nice to properly give it a try when you have released it for testing. Oh that's interesting with the nulls, I just assumed if they were in the database they were there for a reason so good job you spotted it. |
In case you missed it on X/Twitter, there is 8.0.0-dev.2 release and dev build of the Playground with it included out, made some quick videos too... |
Version 8.0.0 package https://pub.dev/packages/flex_color_scheme |
Ooh, that's my favourite part! Thanks for merging! |
I still got as lot of docs to write for https://docs.flexcolorscheme.com/ and video to record as promised, this earlier one, was as mentioned just a teaser https://x.com/RydMike/status/1850651938297159833 |
Hi! Great video—thanks for the update! I was really impressed with the screen recording tool you used in the demo (the one you published on X); it looks fantastic! Could you let me know which tool it is? I’d really appreciate it. |
Thanks 🙏🙂 I used Screen Studio, all the videos were just short single shot quick recordings with no cuts or edits, I only trimmed start and end. It does the zooming and panning and bigger smooth mouse movement, and head inset that shrinks when it zooms, pretty cool. You can do basic edits with it too and manual zooms. I plan to use it for a series of short tutorials that I have been getting requests for. Since these were published on X/Twitter from my free account, it severely reduces video quality, so while I will post the tutorials there too, I will probably post them on YouTube too in 16:9 format, for better quality. I will keep them short by limiting the topic/scope of each one, with some kind of logical progression. Link to the SW https://screen.studio/ It is macOS only. |
Adds a simple way to export playground themes to JSON and then reimport back into the playground so an existing theme can be modified again.
From some discussions in #236.