FlutterWooCommerce class

The class that holds all of the methods

if you want to call some api that it's not already implemented in this class you can use dio object to call the api

Available extensions

Constructors

FlutterWooCommerce({required String baseUrl, required String username, required String password, String? apiPath = '/wp-json/wc/v3', bool isDebug = true, bool useFaker = false, String? lang, int timeout = 60})

Properties

apiPath String?
final
baseUrl String
final
dio ↔ Dio
latefinal
hashCode int
The hash code for this object.
no setterinherited
isDebug bool
final
lang String?
final
password String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout int
final
useFaker bool
final
username String
final

Methods

addItemToStoreCart({required int id, required int quantity, List<Map<String, dynamic>>? variation, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Add item to cart
applyCouponToStoreCart({required String code, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Apply coupon to cart
changePassword(String password) Future<void>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

createOrder({required WooOrder order, bool? useFaker}) Future<WooOrder>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

createShippingMethod({required int zoneId, required String methodId, required String title, int? order, bool? enabled, Map<String, dynamic>? settings, bool? useFaker}) Future<ShippingMethod>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Create a shipping method in a zone
createUserToken({required String userName, required String password}) Future<Map<String, dynamic>>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

deleteAccount(int userId) Future<bool>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

deleteOrder({required int id, bool? useFaker, bool force = false}) Future<bool>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

force Use true whether to permanently delete the order, Default is false.
deleteShippingMethod({required int zoneId, required int instanceId, bool force = false, bool? useFaker}) Future<bool>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Delete a shipping method from a zone
forgotPassword(String email) Future<({String code, int userId})>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

getAttribute(int id, {bool? useFaker}) Future<WooProductAttribute>

Available on FlutterWooCommerce, provided by the WooAttributeApi extension

Retrieve a single product attribute by id
getAttributes({WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, List<int>? exclude, List<int>? include, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.id, bool? useFaker}) Future<List<WooProductAttribute>>

Available on FlutterWooCommerce, provided by the WooAttributeApi extension

List all product attributes Mirrors WooCommerce GET /products/attributes
getAttributeTerm(int attributeId, int termId, {bool? useFaker}) Future<WooProductAttributeTerm>

Available on FlutterWooCommerce, provided by the WooAttributeApi extension

Retrieve a single term for an attribute
getAttributeTerms(int attributeId, {WooContext context = WooContext.view, int page = 1, int perPage = 100, String? search, List<int>? exclude, List<int>? include, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.id, bool? useFaker}) Future<List<WooProductAttributeTerm>>

Available on FlutterWooCommerce, provided by the WooAttributeApi extension

List all terms of a specific attribute
getCart({bool? useFaker}) Future<WooCart>

Available on FlutterWooCommerce, provided by the WooCartApi extension

useFaker, fakes the api request
getCategories({WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, List<int>? exclude, List<int>? include, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.id, bool? hideEmpty, int? parent, int? product, String? slug, bool? useFaker}) Future<List<WooProductCategory>>

Available on FlutterWooCommerce, provided by the WooCategoryApi extension

context Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
getCategory(int id, {bool? useFaker}) Future<WooProductCategory>

Available on FlutterWooCommerce, provided by the WooCategoryApi extension

getCheckoutData({String? bearerToken, bool? useFaker}) Future<StoreCheckoutData>

Available on FlutterWooCommerce, provided by the WooStoreCheckoutApi extension

Get checkout data
getCoupon({required int id, bool? useFaker}) Future<WooCoupon>

Available on FlutterWooCommerce, provided by the WooCouponApi extension

getCoupons({WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, DateTime? after, DateTime? before, DateTime? modifiedAfter, DateTime? modifiedBefore, bool? datesAreGmt, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.date, String? code, bool? useFaker}) Future<List<WooCoupon>>

Available on FlutterWooCommerce, provided by the WooCouponApi extension

context Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
getCurrencies({bool? useFaker}) Future<List<Currency>>

Available on FlutterWooCommerce, provided by the WooCurrencyApi extension

Get all available currencies
getCurrency({required String code, bool? useFaker}) Future<Currency>

Available on FlutterWooCommerce, provided by the WooCurrencyApi extension

Get currency by code
getCurrentCurrency({bool? useFaker}) Future<Currency>

Available on FlutterWooCommerce, provided by the WooCurrencyApi extension

Get current currency
getGroupSettings({required String group, bool? useFaker}) Future<List<Setting>>

Available on FlutterWooCommerce, provided by the WooSettingsApi extension

Get settings for a specific group
getOrder({required int id, bool? useFaker}) Future<WooOrder>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

getOrders({WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, DateTime? after, DateTime? before, DateTime? modifiedAfter, DateTime? modifiedBefore, bool? datesAreGmt, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.date, List<int>? parent, List<int>? parentExclude, List<WooOrderStatus> status = const [WooOrderStatus.any], int? customer, int? product, int? dp, bool? useFaker}) Future<List<WooOrder>>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

context Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
getPaymentGateway({required String id, bool? useFaker}) Future<PaymentGateway>

Available on FlutterWooCommerce, provided by the WooPaymentApi extension

Get a specific payment gateway by ID
getPaymentGateways({WooContext context = WooContext.view, bool? useFaker}) Future<List<PaymentGateway>>

Available on FlutterWooCommerce, provided by the WooPaymentApi extension

context Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
getProduct({required int id, bool? useFaker}) Future<WooProduct>

Available on FlutterWooCommerce, provided by the WooProductApi extension

getProducts({WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, DateTime? after, DateTime? before, DateTime? modifiedAfter, DateTime? modifiedBefore, bool? datesAreGmt, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.date, List<int>? parent, List<int>? parentExclude, String? slug, WooFilterStatus status = WooFilterStatus.any, WooProductType? type, String? sku, bool? featured, int? category, String? tag, int? shippingClass, String? attribute, String? attributeTerm, String? taxClass, bool? onSale, double? minPrice, double? maxPrice, WooProductStockStatus? stockStatus, bool? useFaker, List<Map<String, dynamic>>? filters}) Future<List<WooProduct>>

Available on FlutterWooCommerce, provided by the WooProductApi extension

getProductTags({int page = 1, int perPage = 100, String? search, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.asc, String orderBy = 'name', bool? hideEmpty, int? product, String? slug}) Future<List<Map<String, dynamic>>>

Available on FlutterWooCommerce, provided by the WooProductApi extension

Fetches all product tags from WooCommerce Returns a list of maps containing tag data
getProductVaritaions({required int productId, WooContext context = WooContext.view, int page = 1, int perPage = 10, String? search, DateTime? after, DateTime? before, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.date, List<int>? parent, List<int>? parentExclude, String? slug, WooFilterStatus status = WooFilterStatus.any, String? sku, String? taxClass, bool? onSale, double? minPrice, double? maxPrice, WooProductStockStatus? stockStatus, bool? useFaker}) Future<List<WooProductVariation>>

Available on FlutterWooCommerce, provided by the WooVariationApi extension

context Scope under which the request is made; determines fields present in response. Options: view and edit. Default is view.
getProductWithOptions({required WooProduct product, required List<WooProductFilterWithType> types, bool? useFaker}) Future<WooProductWithChildrens>

Available on FlutterWooCommerce, provided by the WooProductApi extension

getSettings({bool? useFaker}) Future<List<Setting>>

Available on FlutterWooCommerce, provided by the WooSettingsApi extension

Get all settings groups
getShippingMethod({required int zoneId, required int instanceId, bool? useFaker}) Future<ShippingMethod>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Get a specific shipping method in a zone
getShippingMethods({required int zoneId, bool? useFaker}) Future<List<ShippingMethod>>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Get all shipping methods for a zone
getShippingZone({required int id, bool? useFaker}) Future<ShippingZone>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Get a specific shipping zone by ID
getShippingZones({bool? useFaker}) Future<List<ShippingZone>>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Get all shipping zones
getStoreCart({String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Get cart
getUserId({required String token}) Future<int>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

getUserInfo(String email) Future<WooCustomer?>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

login(String email, String password) Future<int>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processCheckout({required StoreCheckoutProcessRequest request, String? bearerToken, bool? useFaker}) Future<StoreCheckoutData>

Available on FlutterWooCommerce, provided by the WooStoreCheckoutApi extension

Process checkout (order and payment)
register(WooCustomer customer) Future<WooCustomer>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

removeCouponFromStoreCart({required String code, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Remove coupon from cart
removeItemFromStoreCart({required String key, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Remove item from cart
searchProductsByCompleteTerm({required String searchTerm, WooContext context = WooContext.view, int page = 1, int perPage = 10, DateTime? after, DateTime? before, DateTime? modifiedAfter, DateTime? modifiedBefore, bool? datesAreGmt, List<int>? exclude, List<int>? include, int? offset, WooSortOrder order = WooSortOrder.desc, WooSortOrderBy orderBy = WooSortOrderBy.title, List<int>? parent, List<int>? parentExclude, String? slug, WooFilterStatus status = WooFilterStatus.any, WooProductType? type, String? sku, bool? featured, int? category, String? tag, int? shippingClass, String? attribute, String? attributeTerm, String? taxClass, bool? onSale, double? minPrice, double? maxPrice, WooProductStockStatus? stockStatus, bool? useFaker, List<Map<String, dynamic>>? filters}) Future<List<WooProduct>>

Available on FlutterWooCommerce, provided by the WooProductApi extension

Enhanced search method that ensures complete search term matching
selectShippingRateInStoreCart({required int packageId, required String rateId, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Select shipping rate for a package
toString() String
A string representation of this object.
inherited
updateCart(List<WooCartItem> items, {bool? useFaker}) Future<WooCart>

Available on FlutterWooCommerce, provided by the WooCartApi extension

items the items of the cart if the item has a quantity equal to 0 then it will be deleted from the cart
updateCheckoutData({required StoreCheckoutUpdateRequest request, String? bearerToken, bool? useFaker}) Future<StoreCheckoutData>

Available on FlutterWooCommerce, provided by the WooStoreCheckoutApi extension

Update checkout data
updateCustomer(WooCustomer user) Future<WooCustomer?>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

updateCustomerInStoreCart({StoreBillingAddress? billingAddress, StoreShippingAddress? shippingAddress, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Update customer data in cart
updateGroupSettings({required String group, required Map<String, dynamic> settings, bool? useFaker}) Future<List<Setting>>

Available on FlutterWooCommerce, provided by the WooSettingsApi extension

Update settings for a specific group
updateItemInStoreCart({required String key, required int quantity, String? bearerToken, bool? useFaker}) Future<StoreCart>

Available on FlutterWooCommerce, provided by the WooStoreCartApi extension

Update item quantity in cart
updateOrder({required WooOrder order, bool? useFaker}) Future<WooOrder>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

updateOrderWithMap({required int id, required Map<String, dynamic> data, bool? useFaker}) Future<WooOrder>

Available on FlutterWooCommerce, provided by the WooOrderApi extension

updatePaymentGateway({required String id, required Map<String, dynamic> data, bool? useFaker}) Future<PaymentGateway>

Available on FlutterWooCommerce, provided by the WooPaymentApi extension

Update a payment gateway
updateShippingMethod({required int zoneId, required int instanceId, String? title, int? order, bool? enabled, Map<String, dynamic>? settings, bool? useFaker}) Future<ShippingMethod>

Available on FlutterWooCommerce, provided by the WooShippingApi extension

Update a shipping method in a zone
verifyUserToken({required String token}) Future<bool>

Available on FlutterWooCommerce, provided by the WooAuthenticationApi extension

/////////////////////////////////////////////////////////////////////////

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

consumerKey String
getter/setter pair
consumerSecret String
getter/setter pair
url String
getter/setter pair