Commit 070313c
authored
Fix/activities screen (#146)
# 🚀 Pull Request
## Brief Description
This pull request resolves two bugs:
1. A workout in utc time would be grouped to the wrong day if the MESZ
time would be within 0.00 and 2.00 because the utc time is then on the
previous day.
2. The refresh indicator would not work if the list view in the
activities screen does not cover the whole screen size.
## GitHub Copilot Text
<!-- GitHub Copilot can suggest a PR description here -->
This pull request introduces several changes to improve the user
interface and data handling in the activities screen and view model. The
most significant updates include refactoring the layout of the grouped
activities list for better scrolling behavior and ensuring workout start
dates are converted to local time for accurate grouping.
### UI Improvements:
* Refactored `_buildGroupedActivities` in `activities_screen.dart` to
wrap the `ListView.builder` in a `LayoutBuilder`,
`SingleChildScrollView`, and `ConstrainedBox` for better handling of
scrolling and layout constraints. This ensures the list always fills the
available space and supports pull-to-refresh behavior.
[[1]](diffhunk://#diff-88f7691689bff6b9ae5559a39398280e2b845d3fe6c13d6a14e5387fb374e83cL144-R156)
[[2]](diffhunk://#diff-88f7691689bff6b9ae5559a39398280e2b845d3fe6c13d6a14e5387fb374e83cR204-R207)
### Code Formatting:
* Adjusted formatting in `_buildGroupedActivities` to improve code
readability, particularly around `Padding` and `Text` widget properties.
### Data Handling:
* Updated `ActivitiesViewModel` in `activities_view_model.dart` to
convert workout start dates to local time before grouping them by day.
This ensures accurate grouping of activities based on the user's local
timezone.
### Minor Changes:
* Added a blank line in the loop processing workouts in
`ActivitiesViewModel` for better code organization.
* Added a blank line after an import statement in
`activities_screen.dart` for consistency.2 files changed
Lines changed: 64 additions & 44 deletions
File tree
- lib/presentation/activities/list
- screen
- view_model
Lines changed: 60 additions & 43 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
168 | 183 | | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
174 | 204 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 205 | + | |
189 | 206 | | |
190 | 207 | | |
191 | 208 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | | - | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
0 commit comments