Skip to content

Commit

Permalink
Update download.dart
Browse files Browse the repository at this point in the history
- fix: was reading the wrong object json
  • Loading branch information
thiagocarvalhodev committed Nov 17, 2023
1 parent 5732031 commit 26a27ae
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/src/streams/download.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,18 +207,16 @@ class TransactionData {
}

void parseData(Map<String, dynamic> jsonData) {
var txData = jsonData['transaction'];

anchor = txData['anchor'];
owner = txData['owner']['key'];
target = txData['recipient'];
signature = txData['signature'];
dataSize = int.parse(txData['data']['size']);
isDataItem = txData['bundledIn'] != null;
quantity = int.parse(txData['quantity']['winston']);
reward = int.parse(txData['fee']['winston']);

var downloadedTags = txData['tags'];
anchor = jsonData['anchor'];
owner = jsonData['owner']['key'];
target = jsonData['recipient'];
signature = jsonData['signature'];
dataSize = int.parse(jsonData['data']['size']);
isDataItem = jsonData['bundledIn'] != null;
quantity = int.parse(jsonData['quantity']['winston']);
reward = int.parse(jsonData['fee']['winston']);

var downloadedTags = jsonData['tags'];
tags = [];
for (var tag in downloadedTags) {
tags.add(createTag(tag['name'], tag['value']));
Expand Down

0 comments on commit 26a27ae

Please sign in to comment.