svthalia / Reaxit

The latest ThaliApp built on Flutter.
GNU General Public License v3.0
11 stars 3 forks source link

Refactor stuff to use dart 3 features #460

Closed DeD1rk closed 4 months ago

DeD1rk commented 11 months ago

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.

JAicewizard commented 11 months ago

I definitely agree on the switch statements, that would be a huge improvement. But I am not sure what you mean by our states?

DeD1rk commented 11 months ago

DetailState, ListState, AuthState etc.