init method

  1. @override
Future<RestApiClient> init()
override

Initializes the client and its handlers.

This method must be called before making any requests. It initializes:

  • The authentication handler (restores stored tokens)
  • The cache handler (if caching is enabled)

Example:

final client = await RestApiClientImpl(options: options).init();

Implementation

@override
Future<RestApiClient> init() async {
  await authHandler.init();
  if (_options.cacheEnabled) {
    await cacheHandler.init();
  }
  return this;
}