Skip to content

Commit b5cb06e

Browse files
committed
v1.0.0
1 parent d5fe7f8 commit b5cb06e

Some content is hidden

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

52 files changed

+5623
-1209
lines changed

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.0/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/home/arif/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.0/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/home/arif/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.0/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"/home/arif/.pub-cache/hosted/pub.dev/device_info_plus-9.0.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/home/arif/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.0/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2023-07-27 13:56:07.508914","version":"3.10.5"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.1.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.8/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.2.0/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.2.0/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","dependencies":[]},{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.1.0/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-02-10 15:54:16.461243","version":"3.16.9"}

.idea/misc.xml

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

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## [1.0.0] - 2023-08-28
1+
## [1.0.0] - 2024-02-10
22

3-
* Initial Release
3+
* Initial Release

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2023 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) 2024 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: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Shopify API Dart plugin
22

3-
[Official WooSignal WooCommerce package](https://woosignal.com)
3+
[Official WooSignal Shopify package](https://woosignal.com)
44

5-
Build apps for WooCommerce easier with our new package.
6-
Our API provides many requests types e.g. getProducts, getOrders and many more.
5+
Build apps for Shopify easier with our new package.
76
Free to get started, see the simple examples below.
87

9-
For help getting started with WooSignal, view our
10-
[online documentation](https://woosignal.com/docs/api/1.0/overview), which offers a more detail guide.
11-
128
### Getting Started #
139
In your flutter project add the dependency:
1410

@@ -35,33 +31,19 @@ import 'package:woosignal_shopify/woosignal_shopify.dart';
3531
_getProducts() async {
3632
3733
// Step 1 - Initialize WooSignal
38-
await WooSignal.instance.init(appKey: "your app key");
34+
await WooSignalShopify.instance.init(appKey: "your app key");
3935
4036
// Step 2 - Call an API
41-
List<Product> products = await WooSignal.instance.getProducts();
37+
ShopifyProductResponse? shopifyProductResponse = await WooSignalShopify.instance.getProducts();
4238
43-
print(products[0].name); // prints a product name
39+
print(shopifyProductResponse?.products?[0].name); // prints a product name
4440
});
4541
}
4642
```
4743

4844
### Available API Requests
4945

50-
#### WooCommerce - Products
51-
- Get Products
52-
- Retrieve a Product by id
53-
- Update a Product by id
54-
- Delete a Product by id
55-
- Create a Product
56-
- Batch update Products
57-
58-
[See Customers API](https://woosignal.com/docs/api/1.0/customers)
59-
60-
#### WooCommerce - API Orders Notes
61-
- List all Orders Notes
62-
- Retrieve a Orders Notes by id
63-
- Delete a Orders Notes by id
64-
- Create a Orders Notes
46+
Coming soon
6547

6648

6749
Disclaimer: This plugin is not affiliated with or supported by Shopify. All logos and trademarks are the property of their respective owners.

example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Example - Returns first product name
22

3-
A new WooCommerce Flutter project.
3+
A new Shopify Flutter project.
44

55
## Getting Started
66

7-
Follow our easy guide online to generate a new app key to start making WooCommerce API requests.
7+
Follow our easy guide online to generate a new app key to start making Shopify API requests.
88
[documentation](https://woosignal.com/docs/api/1.0/overview).
99

1010
For help getting started with Flutter, view our online

example/lib/main.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'package:flutter/material.dart';
2+
import 'package:woosignal_shopify/models/response/shopify_product_response.dart';
23
import 'package:woosignal_shopify/woosignal_shopify.dart';
34

4-
void main(){
5+
void main() {
56
runApp(MyApp());
67
}
78

@@ -13,7 +14,7 @@ class MyApp extends StatelessWidget {
1314
theme: ThemeData(
1415
primarySwatch: Colors.blue,
1516
),
16-
home: MyHomePage(title: 'WooSignal Demo Home Page'),
17+
home: MyHomePage(title: 'WooSignal Demo Home Page'),
1718
);
1819
}
1920
}
@@ -28,16 +29,17 @@ class MyHomePage extends StatefulWidget {
2829
}
2930

3031
class _MyHomePageState extends State<MyHomePage> {
31-
String _productName = "";
32+
String? _productName;
3233

3334
_incrementCounter() async {
34-
// CREATING AN INSTANCE FOR WOOSIGNAL
35-
await WooSignal.instance.init(appKey: "your app key");
35+
// Add your WooSignal API key here
36+
await WooSignalShopify.instance.init(appKey: "your app key");
3637

37-
// ProductResponse? product = await WooSignal.instance.getProducts();
38-
// if (products.isNotEmpty) {
39-
// _productName = products[0].name ?? "";
40-
// }
38+
ShopifyProductResponse? shopifyProductResponse =
39+
await WooSignalShopify.instance.getProducts();
40+
if ((shopifyProductResponse?.products ?? []).isNotEmpty) {
41+
_productName = shopifyProductResponse?.products?[0].title ?? "";
42+
}
4143
setState(() {});
4244
}
4345

@@ -52,9 +54,9 @@ class _MyHomePageState extends State<MyHomePage> {
5254
mainAxisAlignment: MainAxisAlignment.center,
5355
children: <Widget>[
5456
Text('Tap the light bulb to get a product'),
55-
if (_productName != "")
57+
if (_productName != null)
5658
Text(
57-
'WooCommerce product :\n $_productName',
59+
'Shopify product :\n $_productName',
5860
),
5961
],
6062
),

example/pubspec.yaml

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: woosignal_woocommerce_example
1+
name: woosignal_shopify_example
22
description: Demonstrates how to use the woosignal plugin.
33

44
environment:
55
sdk: '>=2.19.0 <3.0.0'
66

77
dependencies:
8+
woosignal_shopify:
9+
path: ../
810
flutter:
911
sdk: flutter
1012
dev_dependencies:
@@ -13,40 +15,6 @@ dev_dependencies:
1315
flutter_test:
1416
sdk: flutter
1517

16-
woosignal_shopify:
17-
path: ../
18-
1918
flutter:
2019

2120
uses-material-design: true
22-
23-
# To add assets to your application, add an assets section, like this:
24-
# assets:
25-
# - images/a_dot_burr.jpeg
26-
# - images/a_dot_ham.jpeg
27-
28-
# An image asset can refer to one or more resolution-specific "variants", see
29-
# https://flutter.io/assets-and-images/#resolution-aware.
30-
31-
# For details regarding adding assets from package dependencies, see
32-
# https://flutter.io/assets-and-images/#from-packages
33-
34-
# To add custom fonts to your application, add a fonts section here,
35-
# in this "flutter" section. Each entry in this list should have a
36-
# "family" key with the font family name, and a "fonts" key with a
37-
# list giving the asset and other descriptors for the font. For
38-
# example:
39-
# fonts:
40-
# - family: Schyler
41-
# fonts:
42-
# - asset: fonts/Schyler-Regular.ttf
43-
# - asset: fonts/Schyler-Italic.ttf
44-
# style: italic
45-
# - family: Trajan Pro
46-
# fonts:
47-
# - asset: fonts/TrajanPro.ttf
48-
# - asset: fonts/TrajanPro_Bold.ttf
49-
# weight: 700
50-
#
51-
# For details regarding fonts from package dependencies,
52-
# see https://flutter.io/custom-fonts/#from-packages

lib/enums/tax_values.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) 2024, 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+
16+
/// TaxName enum
17+
enum TaxName { grt, gst, hst, pst, qst, rst, sst, stateTax, tax, the_00, vat }
18+
19+
/// The following EnumValues class is used to convert the enum to and from a string
20+
final taxNameValues = EnumValues({
21+
"GRT": TaxName.grt,
22+
"GST": TaxName.gst,
23+
"HST": TaxName.hst,
24+
"PST": TaxName.pst,
25+
"QST": TaxName.qst,
26+
"RST": TaxName.rst,
27+
"SST": TaxName.sst,
28+
"State Tax": TaxName.stateTax,
29+
"Tax": TaxName.tax,
30+
"0.0": TaxName.the_00,
31+
"VAT": TaxName.vat
32+
});
33+
34+
/// EnumValues class
35+
class EnumValues<T> {
36+
Map<String, T> map;
37+
late Map<T, String> reverseMap;
38+
39+
EnumValues(this.map);
40+
41+
Map<T, String> get reverse {
42+
reverseMap = map.map((k, v) => MapEntry(v, k));
43+
return reverseMap;
44+
}
45+
}

lib/helpers/shared_pref.dart

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)