init method
Initializes the cache storage system.
This method must be called before using any read/write operations. It sets up the underlying storage system and prepares it for use.
Returns
A Future<void>
that completes when initialization is finished.
Throws
- Exception if storage initialization fails
Example
try {
await CacheStorageHandler.instance.init();
print('Cache storage ready');
} catch (e) {
print('Failed to initialize cache: $e');
}
Implementation
Future<void> init() async {
await GetStorage.init();
}