Skip to content

Commit

Permalink
remove cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Feb 16, 2024
1 parent 8f8d829 commit 98ecabf
Showing 1 changed file with 20 additions and 31 deletions.
51 changes: 20 additions & 31 deletions lib/components/info_cell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,30 +206,19 @@ class InfoCell extends StatelessWidget {

var key = "${project['product']}-info-$env";

// var response = await http.get(Uri.parse(url));
//
// if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) {
// return jsonDecode(response.body)['version'] ?? 'No Info Version';
// } else {
// if (response.bodyBytes.isEmpty) {
// return 'Empty Body';
// } else {
// return response.statusCode.toString();
// }
// }
return remember(key, () async {
var response = await http.get(Uri.parse(url));
// return remember(key, () async {
var response = await http.get(Uri.parse(url));

if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) {
return jsonDecode(response.body)['version'] ?? 'No Info Version';
if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) {
return jsonDecode(response.body)['version'] ?? 'No Info Version';
} else {
if (response.bodyBytes.isEmpty) {
return 'Empty Body';
} else {
if (response.bodyBytes.isEmpty) {
return 'Empty Body';
} else {
return response.statusCode.toString();
}
return response.statusCode.toString();
}
});
}
// });
}

Future<String> getInfoFE(String env, String product) async {
Expand All @@ -244,17 +233,17 @@ class InfoCell extends StatelessWidget {
url = apim_p + basePath + product;
}
var key = "${project['product']}-info-$env";
return remember(key, () async {
var response = await http.get(Uri.parse(url));
if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) {
return jsonDecode(response.body)['version'] ?? 'No Info Version';
// return remember(key, () async {
var response = await http.get(Uri.parse(url));
if (response.statusCode == 200 && response.bodyBytes.isNotEmpty) {
return jsonDecode(response.body)['version'] ?? 'No Info Version';
} else {
if (response.bodyBytes.isEmpty) {
return 'Empty Body';
} else {
if (response.bodyBytes.isEmpty) {
return 'Empty Body';
} else {
return response.statusCode.toString();
}
return response.statusCode.toString();
}
});
}
// });
}
}

0 comments on commit 98ecabf

Please sign in to comment.