Skip to content

Commit 7834c3a

Browse files
author
WooSignal
committed
Fix metadata for orders response
1 parent c6023be commit 7834c3a

File tree

5 files changed

+8
-4
lines changed

5 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.1.1] - 2020-07-03
2+
3+
* Fix MetaData for orders
4+
15
## [1.1.0] - 2020-06-16
26

37
* New MetaData base class for models

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ In your flutter project add the dependency:
1515
``` dart
1616
dependencies:
1717
...
18-
woosignal: ^1.1.0
18+
woosignal: ^1.1.1
1919
```
2020

2121
### Usage example #

lib/models/meta_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class MetaData {
2222

2323
MetaData.fromJson(Map<String, dynamic> json) {
2424
id = json['id'];
25-
key = json['key'];
25+
key = json['key'].toString();
2626
value = json['value'].toString();
2727
}
2828

lib/models/response/order.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class Order {
141141
dateCompleted = json['date_completed'];
142142
dateCompletedGmt = json['date_completed_gmt'];
143143
cartHash = json['cart_hash'];
144-
if (metaData != null) {
144+
if (json['meta_data'] != null) {
145145
metaData =
146146
(json['meta_data'] as List).map((i) => MetaData.fromJson(i)).toList();
147147
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: woosignal
22
description: WooCommerce REST API for dart, connect a WooCommerce store and start developing with our interface for their API endpoints.
3-
version: 1.1.0
3+
version: 1.1.1
44
homepage: https://woosignal.com
55
repository: https://github.com/woosignal/flutter-woocommerce-api
66
issue_tracker: https://github.com/woosignal/flutter-woocommerce-api/issues

0 commit comments

Comments
 (0)