Commit 97b6f59
authored
Check whether historical health functionality is available (#148)
# 🚀 Pull Request
## Brief Description
This pull request hide the corresponding PermissionCard in case of
Health Connect historical health functionality is not available. Apart
from that it also localizes missing read permission.
## Linked Issues
<!-- Link related issues with the format: Fixes #123, Resolves #456,
Closes #1337 -->
- Partly solves #139
## GitHub Copilot Text
This pull request introduces support for checking the availability of
historical health data permissions, refactors error messages to use
localized strings, and updates the UI logic to conditionally display
historical health data options based on availability. Below are the key
changes grouped by theme:
### Localization Updates:
* Added a new localized string `permission_health_read_missing` to both
`lib/l10n/app_de.arb` and `lib/l10n/app_en.arb` for displaying a message
when health data read permissions are missing.
[[1]](diffhunk://#diff-36252c65ab82cbff4774b4983cb9027a2bef4cb738d5ea656c0b903939b3871aR341)
[[2]](diffhunk://#diff-9796fde3771f42a3a759ccc941731d83f96037a661e47dde27ce81d3447a69c2R360)
### Permissions State Enhancements:
* Introduced a new property `isHealthHistoricalAvailable` in the
`PermissionsState` class to track the availability of historical health
data functionality. Updated the constructor, `copyWith` method, and
`PermissionsNotifier` logic to handle this property.
[[1]](diffhunk://#diff-8a4214800464620d2099bc7cfa9c805f54af891b727a07e2d6b5ff7f71f66bacR22-R27)
[[2]](diffhunk://#diff-8a4214800464620d2099bc7cfa9c805f54af891b727a07e2d6b5ff7f71f66bacR37)
[[3]](diffhunk://#diff-8a4214800464620d2099bc7cfa9c805f54af891b727a07e2d6b5ff7f71f66bacR47)
[[4]](diffhunk://#diff-8a4214800464620d2099bc7cfa9c805f54af891b727a07e2d6b5ff7f71f66bacR62-R63)
[[5]](diffhunk://#diff-8a4214800464620d2099bc7cfa9c805f54af891b727a07e2d6b5ff7f71f66bacL287-R310)
### UI Logic Adjustments:
* Updated the `PermissionsPage` and `PermissionsSettingsScreen` widgets
to use the new `isHealthHistoricalAvailable` property instead of relying
solely on the platform check. This ensures the historical health data
option is displayed only when available.
[[1]](diffhunk://#diff-ed114b585bef8ee4333df6f2e72f1c9dfa98c882124fb226aad2ea091e172338L203-R203)
[[2]](diffhunk://#diff-ed114b585bef8ee4333df6f2e72f1c9dfa98c882124fb226aad2ea091e172338L219-R218)
[[3]](diffhunk://#diff-90b689fa9760b9b500d20dba87b979e37ee2b6d7f8034db402842ca07274eeffL196-R196)
[[4]](diffhunk://#diff-90b689fa9760b9b500d20dba87b979e37ee2b6d7f8034db402842ca07274eeffL210-R209)
### Error Message Refactoring:
* Replaced hardcoded error messages for missing health data read
permissions with the localized `permission_health_read_missing` string
across multiple widgets for consistency.
[[1]](diffhunk://#diff-ed114b585bef8ee4333df6f2e72f1c9dfa98c882124fb226aad2ea091e172338L147-R147)
[[2]](diffhunk://#diff-ed114b585bef8ee4333df6f2e72f1c9dfa98c882124fb226aad2ea091e172338L219-R218)
[[3]](diffhunk://#diff-90b689fa9760b9b500d20dba87b979e37ee2b6d7f8034db402842ca07274eeffL139-R139)
[[4]](diffhunk://#diff-90b689fa9760b9b500d20dba87b979e37ee2b6d7f8034db402842ca07274eeffL210-R209)5 files changed
Lines changed: 34 additions & 13 deletions
File tree
- lib
- l10n
- presentation
- onboarding
- providers
- widgets
- profile/screen
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
341 | 342 | | |
342 | 343 | | |
343 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| 360 | + | |
360 | 361 | | |
361 | 362 | | |
362 | 363 | | |
| |||
Lines changed: 24 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| 47 | + | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
| |||
51 | 59 | | |
52 | 60 | | |
53 | 61 | | |
| 62 | + | |
| 63 | + | |
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
| |||
284 | 294 | | |
285 | 295 | | |
286 | 296 | | |
287 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
288 | 311 | | |
289 | 312 | | |
290 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | | - | |
| 147 | + | |
149 | 148 | | |
150 | 149 | | |
151 | 150 | | |
| |||
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | | - | |
204 | | - | |
| 202 | + | |
| 203 | + | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
216 | 215 | | |
217 | 216 | | |
218 | 217 | | |
219 | | - | |
220 | | - | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
| 139 | + | |
141 | 140 | | |
142 | 141 | | |
143 | 142 | | |
| |||
193 | 192 | | |
194 | 193 | | |
195 | 194 | | |
196 | | - | |
197 | | - | |
| 195 | + | |
| 196 | + | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
| |||
207 | 206 | | |
208 | 207 | | |
209 | 208 | | |
210 | | - | |
211 | | - | |
| 209 | + | |
212 | 210 | | |
213 | 211 | | |
214 | 212 | | |
| |||
0 commit comments