-
Notifications
You must be signed in to change notification settings - Fork 3
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
Presets #173
Conversation
* Moved views selection to sidebar
This reverts commit 8817806.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Max! Here's what I changed/fixed:
- moved some classes to their own files
- fixed a problem when loading the preset JSON: In a few cases, you were trying to load a
List<SomeDartType>
, but JSON only works with strings, numbers, bools, or lists/maps of those. So in cases where you want, say aList<ViewPreset>
from JSON, I manually looped over the list of smaller JSONs and passed each one toViewPreset.fromJson
, and built a list that way. With a list comprehension, if you're familiar. - In some cases, you were using
FilesService.writeSettings
directly. That does work, but it only changes your files on disk -- it does not alert Flutter that something has changed. So I switched all those calls toSettingsModel.update
instead, and told the sidebar to listen for those changes. - There was a little clippy warning in the corner if the presets, or any other setting, fail to load. That's because in release mode we simply override any corrupt settings with the defaults. I changed it so that in debug mode it throws a full-on error and does not wipe your settings.
- Instead of loading a preset via a dialog, I added all the presets themselves to the
ExpansionTile
. Clicking on one will load it automatically, and clicking the little delete icon will delete it. The delete dialog still appears, but it no longer asks you to choose a preset since you had to click the delete icon next to the preset. - The old version of
flutter_resizable_container
was giving some issues with precision (eg, ratios adding to 0.9999999 and not 1.0). Upgrading from0.4.2
to3.0.0
helped, and after a little reconfiguring, introduced no further bugs
The errors were pretty subtle, so don't worry about not catching them in the code, but maybe a bit more testing could have caught them (eg, restart to find none of the presets are loaded). Anyway, it's ready to merge now, just figured I'd let you press the green button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving after upgrading the resizable container package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an option to re-order your presets so users can organize them as they wish
Introduced the ability to save, load, delete, and organize presets that remember which views were on screen, in what order, and their sizes.