validateSelectionCount static method

void validateSelectionCount(
  1. int count, {
  2. int? maxAllowed,
})

Implementation

static void validateSelectionCount(int count, {int? maxAllowed}) {
  if (count > FileConstants.hardMaxSelection) {
    throw const CloudMediaSelectionLimitExceededException();
  }
  final limit = maxAllowed ?? FileConstants.defaultMaxSelection;
  if (count > limit) {
    throw CloudMediaSelectionLimitExceededException(
        'Selected $count files exceeds maximum of $limit.');
  }
}