Skip to content

Commit 7fc6078

Browse files
committed
v1.5.0 updates
1 parent 56a456a commit 7fc6078

28 files changed

+54
-418
lines changed

.idea/workspace.xml

Lines changed: 5 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [1.5.0] - 2021-03-17
2+
3+
* Refactor classes
4+
* Ability to fetch app meta data
5+
* Changes as per dart analysis log
6+
17
## [1.4.0] - 2021-03-08
28

39
* Refactor classes

README.md

Lines changed: 9 additions & 9 deletions
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.4.0
18+
woosignal: ^1.5.0
1919
```
2020

2121
### Usage example #
@@ -55,7 +55,7 @@ _getProducts() async {
5555

5656
#### WooCommerce - Products
5757
- Get Products
58-
- Retrive a Product by id
58+
- Retrieve a Product by id
5959
- Update a Product by id
6060
- Delete a Product by id
6161
- Create a Product
@@ -67,7 +67,7 @@ _getProducts() async {
6767

6868
#### WooCommerce - Product Variations
6969
- Get Product Variations
70-
- Retrive a Product Variation by id
70+
- Retrieve a Product Variation by id
7171

7272
[See Product Variations API](https://woosignal.com/docs/api/1.0/products-variations)
7373

@@ -115,14 +115,14 @@ _getProducts() async {
115115

116116
#### WooCommerce - Shipping Zones
117117
- Get Shipping Zones
118-
- Retrive a Shipping Zone by id
118+
- Retrieve a Shipping Zone by id
119119

120120
[See Tax Classes API](https://woosignal.com/docs/api/1.0/tax-classes)
121121

122122

123123
#### WooCommerce - Shipping Zone Locations
124124
- Get Shipping Zone Locations
125-
- Retrive a Shipping Zone Location by id
125+
- Retrieve a Shipping Zone Location by id
126126

127127
[See Shipping Zone Locations API](https://woosignal.com/docs/api/1.0/shipping-zone-locations)
128128

@@ -135,7 +135,7 @@ _getProducts() async {
135135

136136
#### WooCommerce - Orders
137137
- Get Orders
138-
- Retrive a Order by id
138+
- Retrieve a Order by id
139139
- Create an Order
140140
- Update an Order
141141
- Create, Delete and Update Order Multiple Time.
@@ -154,7 +154,7 @@ _getProducts() async {
154154

155155
#### WooCommerce - API Orders Notes
156156
- List all Orders Notes
157-
- Retrive a Orders Notes by id
157+
- Retrieve a Orders Notes by id
158158
- Delete a Orders Notes by id
159159
- Create a Orders Notes
160160

@@ -163,7 +163,7 @@ _getProducts() async {
163163
#### WooCommerce - Refunds
164164
<!-- The refunds API allows you to create, view, and delete individual refunds. -->
165165
- List all all the refunds from an order.
166-
- Retrive a retrieve and view a specific refund from an order
166+
- Retrieve a retrieve and view a specific refund from an order
167167
- Delete a delete an order refund.
168168
- Create a new refund for an order.
169169

@@ -172,7 +172,7 @@ _getProducts() async {
172172
#### WooCommerce - Coupons
173173
<!-- The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes. -->
174174
- List all the coupons that have been created.
175-
- Retrive and view a specific coupon by ID
175+
- Retrieve and view a specific coupon by ID
176176
- This API lets you make changes or update to a coupon.
177177
- Delete a delete a coupon.
178178
- Create, Delete and Update Coupons Multiple Time.

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class _MyHomePageState extends State<MyHomePage> {
6565
),
6666
Text(
6767
'$_productName',
68-
style: Theme.of(context).textTheme.display1,
68+
style: Theme.of(context).textTheme.headline4,
6969
),
7070
],
7171
),

example/test/widget_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// gestures. You can also use WidgetTester to find child widgets in the widget
66
// tree, read text, and verify that the values of widget properties are correct.
77

8-
import 'package:flutter_test/flutter_test.dart';
9-
108
void main() {
11-
testWidgets('Counter increments smoke test', (WidgetTester tester) async {});
9+
1210
}

lib/models/links.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ class Links {
2626

2727
Links.fromJson(Map<String, dynamic> json) {
2828
if (json['self'] != null) {
29-
self = new List<Self>();
29+
self = [];
3030
json['self'].forEach((v) {
3131
self.add(new Self.fromJson(v));
3232
});
3333
}
3434
if (json['collection'] != null) {
35-
collection = new List<Collection>();
35+
collection = [];
3636
json['collection'].forEach((v) {
3737
collection.add(new Collection.fromJson(v));
3838
});
3939
}
4040
if (json['up'] != null) {
41-
up = new List<Collection>();
41+
up = [];
4242
json['up'].forEach((v) {
4343
up.add(new Collection.fromJson(v));
4444
});
4545
}
4646
if (json['describes'] != null) {
47-
describes = new List<Collection>();
47+
describes = [];
4848
json['describes'].forEach((v) {
4949
describes.add(new Collection.fromJson(v));
5050
});

lib/models/payload/order_wc.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ class OrderWC {
5757
customerNote = json['customer_note'];
5858
parentId = json['parent_id'];
5959
if (json['meta_data'] != null) {
60-
metaData = new List<MetaData>();
60+
metaData = [];
6161
json['meta_data'].forEach((v) {
6262
metaData.add(new MetaData.fromJson(v));
6363
});
6464
}
6565
if (json['fee_lines'] != null) {
66-
feeLines = new List<FeeLines>();
66+
feeLines = [];
6767
json['fee_lines'].forEach((v) {
6868
feeLines.add(new FeeLines.fromJson(v));
6969
});
7070
}
7171
if (json['coupon_lines'] != null) {
72-
couponLines = new List<CouponLines>();
72+
couponLines = [];
7373
json['coupon_lines'].forEach((v) {
7474
couponLines.add(new CouponLines.fromJson(v));
7575
});
@@ -80,13 +80,13 @@ class OrderWC {
8080
? new Shipping.fromJson(json['shipping'])
8181
: null;
8282
if (json['line_items'] != null) {
83-
lineItems = new List<LineItems>();
83+
lineItems = [];
8484
json['line_items'].forEach((v) {
8585
lineItems.add(new LineItems.fromJson(v));
8686
});
8787
}
8888
if (json['shipping_lines'] != null) {
89-
shippingLines = new List<ShippingLines>();
89+
shippingLines = [];
9090
json['shipping_lines'].forEach((v) {
9191
shippingLines.add(new ShippingLines.fromJson(v));
9292
});
@@ -164,7 +164,7 @@ class FeeLines {
164164
taxStatus = json['tax_status'];
165165
total = json['total'];
166166
if (json['meta_data'] != null) {
167-
metaData = new List<MetaData>();
167+
metaData = [];
168168
json['meta_data'].forEach((v) {
169169
metaData.add(new MetaData.fromJson(v));
170170
});
@@ -193,7 +193,7 @@ class CouponLines {
193193
CouponLines.fromJson(Map<String, dynamic> json) {
194194
code = json['code'];
195195
if (json['meta_data'] != null) {
196-
metaData = new List<MetaData>();
196+
metaData = [];
197197
json['meta_data'].forEach((v) {
198198
metaData.add(new MetaData.fromJson(v));
199199
});

lib/models/response/api_data.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@
1313
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1414
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1515

16-
import 'dart:convert';
17-
1816
import 'package:woosignal/models/links.dart';
1917

20-
List<ApiData> apiDataFromJson(String str) =>
21-
List<ApiData>.from(json.decode(str).map((x) => ApiData.fromJson(x)));
22-
23-
String apiDataToJson(List<ApiData> data) =>
24-
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
25-
2618
class ApiData {
2719
ApiData({
2820
this.slug,

lib/models/response/continent.dart

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@
1313
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1414
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1515

16-
import 'dart:convert';
17-
1816
import 'package:woosignal/models/links.dart';
1917

20-
List<Continents> continentsFromJson(String str) =>
21-
List<Continents>.from(json.decode(str).map((x) => Continents.fromJson(x)));
22-
23-
String continentsToJson(List<Continents> data) =>
24-
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
25-
2618
class Continents {
2719
Continents({
2820
this.code,
@@ -36,13 +28,12 @@ class Continents {
3628
List<Country> countries;
3729
Links links;
3830

39-
factory Continents.fromJson(Map<String, dynamic> json) => Continents(
40-
code: json["code"],
41-
name: json["name"],
42-
countries: List<Country>.from(
43-
json["countries"].map((x) => Country.fromJson(x))),
44-
links: Links.fromJson(json["_links"]),
45-
);
31+
Continents.fromJson(Map<String, dynamic> json) {
32+
this.code = json["code"];
33+
this.name = json["name"];
34+
this.countries = List<Country>.from(json["countries"].map((x) => Country.fromJson(x)));
35+
this.links = Links.fromJson(json["_links"]);
36+
}
4637

4738
Map<String, dynamic> toJson() => {
4839
"code": code,

lib/models/response/countries.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,8 @@
1313
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1414
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1515

16-
import 'dart:convert';
17-
1816
import 'package:woosignal/models/links.dart';
1917

20-
List<Countries> countriesFromJson(String str) =>
21-
List<Countries>.from(json.decode(str).map((x) => Countries.fromJson(x)));
22-
23-
String countriesToJson(List<Countries> data) =>
24-
json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
25-
2618
class Countries {
2719
Countries({
2820
this.code,

0 commit comments

Comments
 (0)