getState method

Future<Map<String, dynamic>?> getState(
  1. String type
)

Retrieves the shared state for a specific type.

If state hasn't been synced yet, performs an initial sync. Returns the cached state if available.

@param type The state type identifier (e.g., 'userProfile', 'cartItems') @return A Future that resolves to the state data, or null if not found

Implementation

Future<Map<String, dynamic>?> getState(String type) async {
  if (!_hasSyncData) {
    await _syncSharedState();
  }
  return _cachedSharedState[type];
}