WPJsonAPI class

The base class to initialize and use WPJsonAPI

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

api(RequestCallback request) → dynamic
Returns an instance of WPAppNetworkManager which you can use to call your requests from.
getBaseApi() String
Returns the base API
init({required String baseUrl, String wpJsonPath = '/wp-json', bool shouldDebug = true}) → dynamic
Initialize and configure class interface. You can optional set shouldDebug == false to stop debugging wpJsonPath is the root path for accessing you sites WordPress APIs by default this should be "/wp-json".
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldDebug() bool?
Returns the debug value
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance WPJsonAPI
Instance of WPJsonAPI
final
version String
The version
no setter

Static Methods

storageKey() String
Returns the storage key for the plugin
wpAuth() → dynamic
Authenticate a user if they are logged in
wpLogin(WpUser wpUser) → dynamic
Login a user with the WpUser
wpLogout() → dynamic
Logout a user
wpUser() Future<WpUser?>
Returns the logged in user
wpUserId() Future<String?>
Returns the user ID of the logged in user
wpUserLoggedIn() Future<bool>
Check if a user is logged in
wpUserToken() Future<String?>
Get the token for the user