storageIdentity static method

String storageIdentity({
  1. required String? userId,
  2. String? deviceId,
})

The bridge storage identity for one open: the user id, or the device id when there is no user — Android's userId ?: deviceId. Pure, so the shared case-table run pins the choice without a game.

Implementation

static String storageIdentity({required String? userId, String? deviceId}) {
  if (userId != null && userId.trim().isNotEmpty) return userId;
  if (deviceId != null && deviceId.isNotEmpty) return deviceId;
  return '';
}