onUnauthorizedRefreshToken property
When the server returns 401, this callback is invoked to refresh the token. If it returns a non-null string the request is retried once with the new token as a Bearer token.
Implementation
final Future<String?> Function()? onUnauthorizedRefreshToken;