onTokenExpired property
A function fired when the http client gives a 401 response after an API call. It is used to refresh the auth token, if set, and after returning the new token the ConnectionManager will attempt the API call once again.
If null the doApiRequest method will directly return the error.
You can use the onTokenExpiredRuleOverride
parameter to specify other custom rules
to trigger this method depending on the response apart from the 401 status code.
Implementation
final Future<String?> Function()? onTokenExpired;