Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced `HomeworkDialogBloc` with a `Bloc` from [package:bloc](https://pub.dev/packages/bloc). Added unit and golden tests. I tried to keep the behavior mostly the same. There are still some of the same bugs as before (e.g. #1117), they should be fixed in separate PRs. Differences to old behavior: * If any field is changed the quit prompt will appear (e.g. submission enabled, submission time and is private were ignored before) * Pressing save will show errors (red text) like before, but not a `SnackBar` Not so great: * `PrefilledTextField` will we rebuild each time the text changes (title, description) - didn't see any problems because of this though * Code quality is mediocre (e.g. using `HomeworkDto` for the current state in the bloc which lead to _horrible_ hacks for the todo `DateTime`) * Quality of tests if mediocre, good amount of duplication. Also instead of testing each thing seperately I threw some different scenarios (private, not private, with submissions) together which just tested different things at the same time. * Markdown analytics not tested automatically, just manually once * No automatic tests for awaiting or not awaiting API calls depending on if attachments are added because of the Firestore offline behavior where Future won't complete (it works though, tested it manually several times) Good: * Good amount of test coverage * Several golden tests (happy path and errors) * UI is decoupled from business logic * Should be a bit better to add functionality and maintain than before * 🗿 https://github.com/SharezoneApp/sharezone-app/assets/29028262/86ef445f-2424-4607-b3fc-d403d70eafa2 https://github.com/SharezoneApp/sharezone-app/assets/29028262/64332530-0181-4bbf-8a35-d31e62405bc8 Fixes #1115
- Loading branch information