Pebkac03 / espanso_gui

MIT License
6 stars 2 forks source link

State Management #5

Closed Pebkac03 closed 2 months ago

Pebkac03 commented 4 months ago

Struggling with state management in espanso_gui and welcome input from anyone proficient in flutter, the issue is this: The app has a table widget of all matches in different files in the match directory of Espanso. Behind the UI there are two classes that are responsible for storing all matches: EspansoMatch which is an object with all the properties of a match in Espanso. Trigger, replace, vars, etc. Then there is EspansoMatches which is a class containing "matches" where there is one entry for each file with matches, those are then lists of EspansoMatch and also "yaml" which is the Yaml format of the matches. What I want to do is to have any every match widget update its EspansoMatch instance which then notifies that match widget to rebuild. At the same time I want it to update the instance of EspansoMatches without it triggering a rebuild since that would rebuild all matches even if only one was changed. EspansoMatches should then have a save function which can be called to write to Espanso's Yaml config.

Pebkac03 commented 2 months ago

Has been solved with the rewrite.