Fix bug #93 Add an isLoading state
Default value will be true, then set to false after loading complete.
The reason it flickers the No Lists picture is because when initially started the app has no shopping lists loaded. It has no way of telling if this is because there are no lists or the lists are currently being fetched. I add a isLoading state that defaults to true and is set to false when the data is retrieved.
When in an isLoading state, it shows the same color as the splash screen and a spinner. The theme hasn't been loaded at this stage so it's not possible to show the dark or light theme background.
Codecov Report
Merging #102 (f67b06d) into master (5af8fc8) will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #102 +/- ##
=======================================
Coverage 76.96% 76.96%
=======================================
Files 20 20
Lines 534 534
=======================================
Hits 411 411
Misses 123 123
| Flag | Coverage Δ | |
|---|---|---|
| app | 65.99% <ø> (ø) |
|
| bloc | 97.32% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...opping_bloc/lib/src/bloc/shopping_lists_cubit.dart | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 5af8fc8...f67b06d. Read the comment docs.