Skip to content
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

Refactor stuff to use dart 3 features #460

Closed
DeD1rk opened this issue Sep 2, 2023 · 2 comments · Fixed by #486
Closed

Refactor stuff to use dart 3 features #460

DeD1rk opened this issue Sep 2, 2023 · 2 comments · Fixed by #486
Labels
chore Something that is not a bug or a feature, does not change production behaviour priority: low Should be dealt with when nothing else remains.
Milestone

Comments

@DeD1rk
Copy link
Member

DeD1rk commented Sep 2, 2023

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.

@DeD1rk DeD1rk added chore Something that is not a bug or a feature, does not change production behaviour priority: low Should be dealt with when nothing else remains. labels Sep 2, 2023
@JAicewizard
Copy link
Contributor

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
Copy link
Member Author

DeD1rk commented Sep 4, 2023

DetailState, ListState, AuthState etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Something that is not a bug or a feature, does not change production behaviour priority: low Should be dealt with when nothing else remains.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants