Skip to content

Commit

Permalink
Edit remote file json
Browse files Browse the repository at this point in the history
  • Loading branch information
SepehrFakoori committed Jul 11, 2024
1 parent deb8744 commit adf6794
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/util/map_to_list_convertor.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
List<Map<String, dynamic>> convertMap(Map<String, dynamic> mapObject, String kind) {
List<Map<String, dynamic>> result = [];
Map<String, dynamic> currencies = mapObject['result'][kind];

currencies.forEach((key, value) {
Map<String, dynamic> currencyMap = {
'name': key,
'p': value['p'],
'h': value['h'],
'l': value['l'],
'd': value['d'],
'dp': value['dp'],
'ts': value['ts'],
};
result.add(currencyMap);
});

return result;
}

0 comments on commit adf6794

Please sign in to comment.