Better error handling in fetch data
This commit is contained in:
parent
1a2cdfd814
commit
d3cd6012e6
3 changed files with 17 additions and 21 deletions
|
|
@ -47,9 +47,10 @@ class FiresApi {
|
|||
final mobileToken = state.user.token;
|
||||
final String url = '${state
|
||||
.firesApiUrl}mobile/subscriptions/all/$apiKey/$mobileToken';
|
||||
// if (globals.isDevelopment) print('$url');
|
||||
return await resty.get(url).go().then((response) {
|
||||
if (response.statusCode == 200) {
|
||||
// print(response.body);
|
||||
// if (globals.isDevelopment) print(response.body);
|
||||
final dataSubscriptions =
|
||||
json.decode(response.body)['data']['subscriptions'];
|
||||
List<YourLocation> subscribed = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue