Skip to content

Commit 6fabeed

Browse files
committed
v3.6.1 update
1 parent 52f1de9 commit 6fabeed

File tree

6 files changed

+26
-21
lines changed

6 files changed

+26
-21
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Files and directories created by pub.
22
.dart_tool/
33
.packages
4-
.idea
4+
.idea/
55
.flutter-plugins
66

77
# Conventional directory for build outputs.

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [3.6.1] - 2023-07-03
2+
3+
* Fix dart analysis `refer_interpolation_to_compose_strings` in project.
4+
15
## [3.6.0] - 2023-07-03
26

37
* Fix orderBy parameter for `getProducts()`.

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.6.0
18+
woosignal: ^3.6.1
1919
```
2020

2121
### Usage example #

lib/helpers/shared_pref.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ _storeUUID(String uuid) async {
3939
String _buildUUID() {
4040
var uuid = Uuid();
4141
String idD = uuid.v1();
42-
return idD + "_" + _randomStr(5);
42+
return "${idD}_${_randomStr(5)}";
4343
}
4444

4545
String _randomStr(int strLen) {

lib/woosignal.dart

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import 'package:woosignal/models/response/setting_option_batch.dart';
5353
import 'package:woosignal/models/response/product_batch.dart';
5454

5555
/// WooSignal Package version
56-
const String wooSignalVersion = "3.6.0";
56+
const String wooSignalVersion = "3.6.1";
5757

5858
class WooSignal {
5959
WooSignal._privateConstructor();
@@ -257,7 +257,7 @@ class WooSignal {
257257
return await _wooSignalRequest<List<ProductVariation>>(
258258
method: "get",
259259
payload: payload,
260-
path: "products/" + productId.toString() + "/variations",
260+
path: "products/$productId/variations",
261261
jsonResponse: (json) =>
262262
(json as List).map((i) => ProductVariation.fromJson(i)).toList(),
263263
) ??
@@ -304,7 +304,7 @@ class WooSignal {
304304
return await _wooSignalRequest<List<ProductAttributeTerm>>(
305305
method: "get",
306306
payload: payload,
307-
path: "products/attributes/" + attributeId.toString() + "/terms",
307+
path: "products/attributes/$attributeId/terms",
308308
jsonResponse: (json) => (json as List)
309309
.map((i) => ProductAttributeTerm.fromJson(i))
310310
.toList(),
@@ -645,7 +645,7 @@ class WooSignal {
645645

646646
return await _wooSignalRequest<Order?>(
647647
method: "get",
648-
path: "orders/" + id.toString(),
648+
path: "orders/$id",
649649
payload: payload,
650650
jsonResponse: (json) => Order.fromJson(json),
651651
);
@@ -656,7 +656,7 @@ class WooSignal {
656656
{required Map<String, dynamic> data}) async {
657657
return await _wooSignalRequest<Order?>(
658658
method: "put",
659-
path: "orders/" + id.toString(),
659+
path: "orders/$id",
660660
payload: data,
661661
jsonResponse: (json) => Order.fromJson(json),
662662
);
@@ -737,7 +737,7 @@ class WooSignal {
737737
Future<ShippingZone?> retrieveShippingZone(int id) async {
738738
return await _wooSignalRequest<ShippingZone?>(
739739
method: "get",
740-
path: "shipping/zones/" + id.toString(),
740+
path: "shipping/zones/$id",
741741
jsonResponse: (json) => ShippingZone.fromJson(json),
742742
);
743743
}
@@ -1046,8 +1046,9 @@ class WooSignal {
10461046
if (minimumAmount != null) payload['minimum_amount'] = minimumAmount;
10471047
if (usageLimit != null) payload['usage_limit'] = usageLimit;
10481048
if (productIds != null) payload['product_ids'] = productIds;
1049-
if (emailRestrictions != null)
1049+
if (emailRestrictions != null) {
10501050
payload['email_restrictions'] = emailRestrictions;
1051+
}
10511052
if (description != null) payload['description'] = description;
10521053

10531054
return await _wooSignalRequest<Coupon?>(
@@ -1063,7 +1064,7 @@ class WooSignal {
10631064
{required Map<String, dynamic> data}) async {
10641065
return await _wooSignalRequest<Coupon?>(
10651066
method: "put",
1066-
path: "coupons/" + id.toString(),
1067+
path: "coupons/$id",
10671068
payload: data,
10681069
jsonResponse: (json) => Coupon.fromJson(json),
10691070
);
@@ -1073,7 +1074,7 @@ class WooSignal {
10731074
Future<Coupon?> deleteCoupon(int id, {bool force = false}) async {
10741075
return await _wooSignalRequest<Coupon?>(
10751076
method: "delete",
1076-
path: "coupons/" + id.toString(),
1077+
path: "coupons/$id",
10771078
payload: {'force': force},
10781079
jsonResponse: (json) => Coupon.fromJson(json),
10791080
);
@@ -1140,7 +1141,7 @@ class WooSignal {
11401141
{required Map<String, dynamic> data}) async {
11411142
return await _wooSignalRequest<Customers?>(
11421143
method: "put",
1143-
path: "customers/" + id.toString(),
1144+
path: "customers/$id",
11441145
payload: data,
11451146
jsonResponse: (json) => Customers.fromJson(json),
11461147
);
@@ -1152,7 +1153,7 @@ class WooSignal {
11521153

11531154
return await _wooSignalRequest<Customers?>(
11541155
method: "delete",
1155-
path: "customers/" + id.toString(),
1156+
path: "customers/$id",
11561157
payload: payload,
11571158
jsonResponse: (json) => Customers.fromJson(json),
11581159
);
@@ -1296,7 +1297,7 @@ class WooSignal {
12961297
Map<String, dynamic> payload = {'force': force};
12971298
return await _wooSignalRequest<ob.Orders?>(
12981299
method: "delete",
1299-
path: "orders/" + id.toString(),
1300+
path: "orders/$id",
13001301
payload: payload,
13011302
jsonResponse: (json) => ob.Orders.fromJson(json),
13021303
);
@@ -1389,7 +1390,7 @@ class WooSignal {
13891390
{required Map<String, dynamic> data}) async {
13901391
return await _wooSignalRequest<Product?>(
13911392
method: "put",
1392-
path: "products/" + id.toString(),
1393+
path: "products/$id",
13931394
payload: data,
13941395
jsonResponse: (json) => Product.fromJson(json),
13951396
);
@@ -1400,7 +1401,7 @@ class WooSignal {
14001401
Map<String, dynamic> payload = {'force': force};
14011402
return await _wooSignalRequest<Product?>(
14021403
method: "delete",
1403-
path: "products/" + id.toString(),
1404+
path: "products/$id",
14041405
payload: payload,
14051406
jsonResponse: (json) => Product.fromJson(json),
14061407
);
@@ -1437,7 +1438,7 @@ class WooSignal {
14371438
Future<ProductTag?> retrieveProductTag(int id) async {
14381439
return await _wooSignalRequest<ProductTag?>(
14391440
method: "get",
1440-
path: "products/tags/" + id.toString(),
1441+
path: "products/tags/$id",
14411442
jsonResponse: (json) => ProductTag.fromJson(json),
14421443
);
14431444
}
@@ -1485,7 +1486,7 @@ class WooSignal {
14851486
{Map<String, dynamic>? data}) async {
14861487
return await _wooSignalRequest<ProductTag?>(
14871488
method: "put",
1488-
path: "products/tags/" + productTagId.toString(),
1489+
path: "products/tags/$productTagId",
14891490
payload: data ?? {},
14901491
jsonResponse: (json) => ProductTag.fromJson(json),
14911492
);
@@ -1497,7 +1498,7 @@ class WooSignal {
14971498
Map<String, dynamic> payload = {"force": force};
14981499
return await _wooSignalRequest<ProductTag?>(
14991500
method: "delete",
1500-
path: "products/tags/" + productTagId.toString(),
1501+
path: "products/tags/$productTagId",
15011502
payload: payload,
15021503
jsonResponse: (json) => ProductTag.fromJson(json),
15031504
);

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: 3.5.0
3+
version: 3.6.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)