Skip to content

Commit d5b6aca

Browse files
authored
Merge pull request #6 from woosignal/master
v3.0.3 - updates
2 parents e4f1e07 + 5400339 commit d5b6aca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+96
-60
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 by WooSignal Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1+
Copyright (c) 2022 by WooSignal Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
22

33
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
44
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

README.md

Lines changed: 1 addition & 1 deletion

lib/helpers/shared_pref.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/collection.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/image.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/links.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted
@@ -52,8 +52,7 @@ class Links {
5252
}
5353

5454
Map<String, dynamic> toJson() {
55-
// ignore: prefer_collection_literals
56-
final Map<String, dynamic> data = Map<String, dynamic>();
55+
final Map<String, dynamic> data = <String, dynamic>{};
5756
if (self != null) {
5857
data['self'] = self!.map((v) => v.toJson()).toList();
5958
}

lib/models/meta_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/payload/order_wc.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/api_data.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/continent.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/countries.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/coupon.dart

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted
@@ -30,19 +30,19 @@ class Coupon {
3030
String? dateExpiresGmt;
3131
int? usageCount;
3232
bool? individualUse;
33-
List<dynamic>? productIds;
34-
List<dynamic>? excludedProductIds;
33+
List<int>? productIds;
34+
List<int>? excludedProductIds;
3535
int? usageLimit;
3636
int? usageLimitPerUser;
3737
int? limitUsageToXItems;
3838
bool? freeShipping;
39-
List<dynamic>? productCategories;
40-
List<dynamic>? excludedProductCategories;
39+
List<int>? productCategories;
40+
List<int>? excludedProductCategories;
4141
bool? excludeSaleItems;
4242
String? minimumAmount;
4343
String? maximumAmount;
44-
List<dynamic>? emailRestrictions;
45-
List<dynamic>? usedBy;
44+
List<String>? emailRestrictions;
45+
List<String>? usedBy;
4646
List<MetaData>? metaData;
4747
Links? links;
4848

@@ -90,27 +90,28 @@ class Coupon {
9090
dateExpiresGmt = json['date_expires_gmt'];
9191
usageCount = json['usage_count'];
9292
individualUse = json['individual_use'];
93-
productIds = (json['product_ids'] != null) ? json['product_ids'] : null;
93+
productIds =
94+
(json['product_ids'] != null) ? json['product_ids'].cast<int>() : null;
9495
excludedProductIds = (json['excluded_product_ids'] != null)
95-
? json['excluded_product_ids']
96+
? json['excluded_product_ids'].cast<int>()
9697
: null;
9798
usageLimit = json['usage_limit'];
9899
usageLimitPerUser = json['usage_limit_per_user'];
99100
limitUsageToXItems = json['limit_usage_to_x_items'];
100101
freeShipping = json['free_shipping'];
101102
productCategories = (json['product_categories'] != null)
102-
? json['product_categories']
103+
? json['product_categories'].cast<int>()
103104
: null;
104-
productCategories = (json['product_categories'] != null)
105-
? json['product_categories']
105+
excludedProductCategories = (json['excluded_product_categories'] != null)
106+
? json['excluded_product_categories'].cast<int>()
106107
: null;
107108
excludeSaleItems = json['exclude_sale_items'];
108109
minimumAmount = json['minimum_amount'];
109110
maximumAmount = json['maximum_amount'];
110111
emailRestrictions = (json['email_restrictions'] != null)
111-
? json['email_restrictions']
112+
? json['email_restrictions'].cast<String>()
112113
: null;
113-
usedBy = (json['used_by'] != null) ? json['used_by'] : null;
114+
usedBy = (json['used_by'] != null) ? json['used_by'].cast<String>() : null;
114115
if (json['meta_data'] != null) {
115116
metaData = [];
116117
json['meta_data'].forEach((v) {

lib/models/response/coupon_batch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/currencies.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/customer.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/customer_batch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/customer_download.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// Copyright (c) 2022, WooSignal Ltd.
2+
// All rights reserved.
3+
//
4+
// Redistribution and use in source and binary forms are permitted
5+
// provided that the above copyright notice and this paragraph are
6+
// duplicated in all such forms and that any documentation,
7+
// advertising materials, and other materials related to such
8+
// distribution and use acknowledge that the software was developed
9+
// by the WooSignal. The name of the
10+
// WooSignal may not be used to endorse or promote products derived
11+
// from this software without specific prior written permission.
12+
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15+
116
import 'package:woosignal/models/links.dart';
217

318
class CustomerDownload {

lib/models/response/order.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/order_batch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/order_notes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/payment_gateway.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_attribute_term.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_attributes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_batch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_category.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd Ltd
1+
// Copyright (c) 2022, WooSignal Ltd
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_review.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_shipping_class.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/product_variation.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/products.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/refund.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/reports.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/sale_report.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/setting_option.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/setting_option_batch.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/shipping_method.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/shipping_zone.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/shipping_zone_location.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/system_status.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/tax_classes.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/tax_rate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/top_seller_report.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/models/response/woosignal_app.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted
@@ -25,6 +25,7 @@ class WooSignalApp {
2525
bool? stripeLiveMode;
2626
String? stripeAccount;
2727
int? wpLoginEnabled;
28+
bool? couponEnabled;
2829
String? wpLoginBaseUrl;
2930
String? wpLoginForgotPasswordUrl;
3031
String? wpLoginWpApiPath;
@@ -37,6 +38,7 @@ class WooSignalApp {
3738
bool? stripeEnabled;
3839
bool? codEnabled;
3940
bool? paypalEnabled;
41+
bool? wishlistEnabled;
4042
bool? paypalLiveMode;
4143
String? stripeCountryCode;
4244
String? themeFont;
@@ -69,6 +71,8 @@ class WooSignalApp {
6971
this.paypalEnabled,
7072
this.paypalLiveMode,
7173
this.stripeCountryCode,
74+
this.couponEnabled,
75+
this.wishlistEnabled,
7276
this.themeFont,
7377
this.socialLinks,
7478
this.themeColors});
@@ -87,6 +91,16 @@ class WooSignalApp {
8791
stripeLiveMode = json['stripe_live_mode'];
8892
stripeAccount = json['stripe_account'];
8993
wpLoginEnabled = json['wp_login_enabled'];
94+
if (json['wishlist_enabled'] is int && json['wishlist_enabled'] == 1) {
95+
wishlistEnabled = true;
96+
} else {
97+
wishlistEnabled = false;
98+
}
99+
if (json['coupon_enabled'] is int && json['coupon_enabled'] == 1) {
100+
couponEnabled = true;
101+
} else {
102+
couponEnabled = false;
103+
}
90104
wpLoginBaseUrl = json['wp_login_base_url'];
91105
wpLoginForgotPasswordUrl = json['wp_login_forgot_password_url'];
92106
wpLoginWpApiPath = json['wp_login_wp_api_path'];
@@ -121,6 +135,8 @@ class WooSignalApp {
121135
data['app_termslink'] = appTermsLink;
122136
data['app_privacylink'] = appPrivacyLink;
123137
data['app_debug'] = appDebug;
138+
data['wishlist_enabled'] = wishlistEnabled;
139+
data['coupon_enabled'] = couponEnabled;
124140
data['app_status'] = appStatus;
125141
if (currencyMeta != null) {
126142
data['currency_meta'] = currencyMeta!.toJson();

0 commit comments

Comments
 (0)