Skip to content

Commit 4b3a794

Browse files
committed
v3.0.4 - updates
1 parent 5400339 commit 4b3a794

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [3.0.4] - 2022-01-28
2+
3+
* Add new variables to woosignal_app
4+
* Update arguments for product review
5+
* Dependency updates
6+
17
## [3.0.3] - 2022-01-03
28

39
* Update coupon property types

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: ^3.0.3
18+
woosignal: ^3.0.4
1919
```
2020

2121
### Usage example #

lib/models/response/woosignal_app.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class WooSignalApp {
2626
String? stripeAccount;
2727
int? wpLoginEnabled;
2828
bool? couponEnabled;
29+
bool? showProductReviews;
30+
bool? showRelatedProducts;
31+
bool? showUpsellProducts;
2932
String? wpLoginBaseUrl;
3033
String? wpLoginForgotPasswordUrl;
3134
String? wpLoginWpApiPath;
@@ -101,6 +104,21 @@ class WooSignalApp {
101104
} else {
102105
couponEnabled = false;
103106
}
107+
if (json['show_product_reviews'] is int && json['show_product_reviews'] == 1) {
108+
showProductReviews = true;
109+
} else {
110+
showProductReviews = false;
111+
}
112+
if (json['show_related_products'] is int && json['show_related_products'] == 1) {
113+
showRelatedProducts = true;
114+
} else {
115+
showRelatedProducts = false;
116+
}
117+
if (json['show_upsell_products'] is int && json['show_upsell_products'] == 1) {
118+
showUpsellProducts = true;
119+
} else {
120+
showUpsellProducts = false;
121+
}
104122
wpLoginBaseUrl = json['wp_login_base_url'];
105123
wpLoginForgotPasswordUrl = json['wp_login_forgot_password_url'];
106124
wpLoginWpApiPath = json['wp_login_wp_api_path'];

lib/woosignal.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,11 @@ class WooSignal {
428428
/// https://woosignal.com/docs/api/1.0/product-reviews
429429
Future<ProductReview?> createProductReview(
430430
{int? productId,
431-
int? status,
431+
String? status,
432432
String? reviewer,
433433
String? reviewerEmail,
434434
String? review,
435-
int? rating,
435+
int? rating, // Review rating (0 to 5)
436436
bool? verified}) async {
437437
Map<String, dynamic> payload = {};
438438

pubspec.yaml

Lines changed: 2 additions & 2 deletions
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: 3.0.3
3+
version: 3.0.4
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
@@ -12,7 +12,7 @@ environment:
1212
dependencies:
1313
dio: ^4.0.4
1414
device_info: ^2.0.3
15-
shared_preferences: ^2.0.11
15+
shared_preferences: ^2.0.12
1616
uuid: ^3.0.5
1717

1818
flutter:

0 commit comments

Comments
 (0)