getActiveConversations method

Future<List<String>> getActiveConversations()

Gets a list of all active conversation keys.

Implementation

Future<List<String>> getActiveConversations() async {
  final activeKeys = <String>[];
  final allKeys = await storage.getAllKeys();

  for (final key in allKeys) {
    final state = await storage.get(key);
    if (state != null && state.isActive && !_isConversationExpired(state)) {
      activeKeys.add(key);
    }
  }

  return activeKeys;
}