Skip to content

Commit a24fbdb

Browse files
committed
v2.3.0
1 parent 2e2a14c commit a24fbdb

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class MyHomePage extends StatefulWidget {
3131
class _MyHomePageState extends State<MyHomePage> {
3232
String? _productName;
3333

34-
_incrementCounter() async {
34+
Future<void> _incrementCounter() async {
3535
// Add your WooSignal API key here
3636
await WooSignalShopify.instance.init(appKey: "your app key");
3737

lib/models/product.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Product {
105105
return option != null ? option.values : [];
106106
}
107107

108-
findVariation(Map<int, dynamic> options) {
108+
Variants? findVariation(Map<int, dynamic> options) {
109109
List<int?> positions = this.options!.map((e) => e.position).toList();
110110

111111
List<Variants>? variants;

lib/networking/api_provider.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ class ApiProvider {
9292
}
9393

9494
/// Init Dio class
95-
_initDio() {
95+
void _initDio() {
9696
BaseOptions options =
9797
BaseOptions(baseUrl: "https://api.woosignal.com/shopify/v1/");
9898
_dio = Dio(options);
9999
}
100100

101101
/// Set the http headers for Dio
102-
_setDioHeaders() {
102+
void _setDioHeaders() {
103103
Map<String, dynamic> headers = {
104104
"Authorization": "Bearer $_apiKey",
105105
"Content-Type": "application/json",
@@ -123,7 +123,7 @@ class ApiProvider {
123123
Future init() async {
124124
_initDio();
125125
await setDeviceMeta();
126-
await _setDioHeaders();
126+
_setDioHeaders();
127127
}
128128

129129
/// Print to the console with a [log] response
@@ -134,7 +134,7 @@ class ApiProvider {
134134
}
135135

136136
/// HTTP POST request using a [url] and [data] payload
137-
Future<dynamic> post(url, data) async {
137+
Future<dynamic> post(String url, data) async {
138138
try {
139139
Response response = await _dio.post(url, data: data);
140140
return response.data;
@@ -144,7 +144,7 @@ class ApiProvider {
144144
}
145145
}
146146

147-
Future<dynamic> put(url, data) async {
147+
Future<dynamic> put(String url, data) async {
148148
try {
149149
Response response = await _dio.put(url, data: data);
150150
return response.data;
@@ -155,7 +155,7 @@ class ApiProvider {
155155
}
156156

157157
/// HTTP GET request using a [url]
158-
Future<dynamic> get(url, {dynamic data}) async {
158+
Future<dynamic> get(String url, {dynamic data}) async {
159159
try {
160160
Response response =
161161
await _dio.get(url, queryParameters: data, data: data);

lib/woosignal_shopify_api.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ class WooSignalShopify {
167167
}
168168

169169
/// Login a user with the [AuthCustomer]
170-
static authLogin(AuthCustomer authCustomer) async {
170+
static Future<void> authLogin(AuthCustomer authCustomer) async {
171171
await Auth.authenticate(data: authCustomer);
172172
}
173173

174174
/// Logout a user
175-
static authLogout() async {
175+
static Future<void> authLogout() async {
176176
await Auth.logout();
177177
}
178178

0 commit comments

Comments
 (0)