Closed DeD1rk closed 4 months ago
I think it may be really nice to refactor all/most of our 'states' into sealed classes.
The UI code can then be cleaned up a lot by using switch expressions instead of loads of if-statements.
https://medium.com/@aliammariraq/sealed-classes-in-dart-unlocking-powerful-features-d8dba185925f gives some examples and background on the language changes.
I definitely agree on the switch statements, that would be a huge improvement. But I am not sure what you mean by our states?
states
DetailState, ListState, AuthState etc.
What
I think it may be really nice to refactor all/most of our 'states' into sealed classes.
Why
The UI code can then be cleaned up a lot by using switch expressions instead of loads of if-statements.
How
https://medium.com/@aliammariraq/sealed-classes-in-dart-unlocking-powerful-features-d8dba185925f gives some examples and background on the language changes.