initStorage method

Future<void> initStorage()

Initialize storage and load existing queue

Implementation

Future<void> initStorage() async {
  final storage = ABUSManager.instance.storage;
  if (storage == null) return;

  // Load initial data
  final data = await storage.load(_storageKey);
  if (data != null && data['queue'] is List) {
    _updateFromSerializedData(data);
  }

  // Watch for external changes (cross-app sync)
  _storageSubscription?.cancel();
  _storageSubscription = storage.watch(_storageKey).listen((data) {
    if (data != null) {
      _updateFromSerializedData(data, notify: true);
    }
  });
}