WPAppNetworkManager class

A networking class to manage all the APIs from "wp_json_api"

Properties

dio ↔ Dio
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
wcCustomerInfo({String? userToken}) Future<WCCustomerInfoResponse>
Get the users WooCommerce information using the userToken.
wcPointsAndRewardsCalculatePoints({required double points, String? userToken}) Future<WcPointsAndRewardCalculatePoints>
Calculate the value of points using the userToken and points.
wcPointsAndRewardsUser({String? userToken}) Future<WcPointsAndRewardUser>
Get the users points and rewards information using the userToken.
wcRegister({required String email, required String password, String? username, String? expiry, Map<String, dynamic>? args, bool saveTokenToLocalStorage = true}) Future<WPUserRegisterResponse>
Sends a request to register a user in WooCommerce with the following parameters username, email and password. You can optionally set an expiry for the token expiry like "+1 day".
wcUpdateCustomerInfo({String? userToken, String? firstName, String? lastName, String? displayName, String? billingFirstName, String? billingLastName, String? billingCompany, String? billingAddress1, String? billingAddress2, String? billingCity, String? billingState, String? billingPostcode, String? billingCountry, String? billingEmail, String? billingPhone, String? shippingFirstName, String? shippingLastName, String? shippingCompany, String? shippingAddress1, String? shippingAddress2, String? shippingCity, String? shippingState, String? shippingPostcode, String? shippingCountry, String? shippingEmail, String? shippingPhone}) Future<WCCustomerUpdatedResponse>
Sends a request to update a users WooCommerce details using a valid userToken, set optional parameters for updating user.
wpGetUserInfo({String? userToken}) Future<WPUserInfoResponse>
Sends a request to get a users WordPress info using a valid userToken.
wpLogin({String? email, String? username, required String password, WPAuthType authType = WPAuthType.WpEmail, String? tokenExpiryAt, bool saveTokenToLocalStorage = true}) Future<WPUserLoginResponse>
Sends a request to login a user with the email & password or username and password. Set authType to auth with email/username.
wpLogout() → dynamic
Logs out the user by deleting the user token from the local storage
wpNonce() Future<WPNonceResponse>
Makes a request to get a valid nonce code
wpNonceVerify({required String nonce}) Future<WPNonceVerifiedResponse>
Sends a request to check if a given nonce value is still valid.
wpRegister({required String email, required String password, String? username, String? expiry, Map<String, dynamic>? args, bool saveTokenToLocalStorage = true}) Future<WPUserRegisterResponse>
Sends a request to register a user in WordPress with the following parameters username, email and password. You can optionally set an expiry for the token expiry like "+1 day".
wpResetPassword({required String password, String? userToken}) Future<WPUserResetPasswordResponse>
Reset a user password using the userToken and new password created.
wpUpdateUserInfo({String? userToken, String? firstName, String? lastName, String? displayName, List<WpMetaData>? metaData}) Future<WPUserInfoUpdatedResponse>
Sends a request to update details for a WordPress user. Include a valid userToken to send a successful request. Optional parameters include a firstName, lastName, displayName or metaData to update user's.
wpUserAddRole({required String role, String? userToken}) Future<WPUserAddRoleResponse>
Sends a request to add a role to a WordPress user. Include a valid userToken and role to send a successful request.
wpUserDelete({String? userToken, int? reassign}) Future<WPUserDeleteResponse>
Sends a request to delete a WordPress user. Include a valid userToken and an optional reassign argument to send a successful request.
wpUserRemoveRole({required String role, String? userToken}) Future<WPUserRemoveRoleResponse>
Sends a request to remove a role from a WordPress user. Include a valid userToken and role to send a successful request.

Operators

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

Static Properties

instance WPAppNetworkManager
An instance of WPAppNetworkManager class
final