storeToken static method

dynamic storeToken(
  1. String token
)

Store Token Functionality.

Token is used to verify authentication status in the app. If storage has stored_token then authentication status is VALID (AuthStatus.valid) and if there is no token authentication status is INVALID (AuthStatus.inValid).

Always use BaseHttp clearCacheStorage function when you need to clear token or make authentication status AuthStatus.inValid\

Implementation

static storeToken(String token) async {
  try {
    await _storage.write(_tokenStorageKey, token);
  } catch (e) {
    kLog("Error storing token!", tag: classTag, logStatus: LogStatus.ERROR);
  }
}