WpUser class

The logged in user that wp_json_api stores on the device.

Inheritance

Constructors

WpUser({int? id, String? token, int? expiresAt, String? email, String? username, String? firstName, String? lastName, String? avatar, String? createdAt})
WpUser.fromJson(Map<String, dynamic> json)
Creates a WpUser from a JSON object
WpUser.fromWPUserLoginResponse(WPUserLoginResponse wpUserLoginResponse)
Creates a WpUser from a WPUserLoginResponse
WpUser.fromWPUserRegisterResponse(WPUserRegisterResponse wpUserRegisterResponse)
Creates a WpUser from a WPUserRegisterResponse

Properties

avatar ↔ String?
getter/setter pair
createdAt ↔ String?
getter/setter pair
email ↔ String?
getter/setter pair
expiresAt ↔ int?
When the token expires, as a Unix timestamp in seconds.
getter/setter pair
expiresAtDateTime → DateTime?
Returns expiresAt as a DateTime, or null if it is not set.
no setter
firstName ↔ String?
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
id ↔ int?
getter/setter pair
isTokenExpired → bool
Returns true if the token has expired on this device.
no setter
lastName ↔ String?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token ↔ String?
getter/setter pair
username ↔ String?
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save({bool inBackpack = false}) → Future
Save the object to secure storage using a unique key. E.g. User class
inherited
saveToCollection({bool inBackpack = false}) → Future
Save an item to a collection.
inherited
syncToBackpack() → Future<bool>
Attempt to login a user using a storageKey.
inherited
toJson() → Map<String, dynamic>
Converts the WpUser to a JSON object
override
toString() → String
A string representation of this object.
inherited

Operators

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