init method

  1. @override
Future<RestApiClient> init([
  1. bool migrateFromHive = true
])
override

Initializes the client by preparing auth and cache handlers.

Implementation

@override
Future<RestApiClient> init([bool migrateFromHive = true]) async {
  await authHandler.init(
    migrateFromHive,
  ); // Initialize authentication handler
  if (_options.cacheEnabled) {
    await cacheHandler
        .init(); // Initialize cache handler if caching is enabled
  }

  return this; // Return the client instance
}