import 'dart:math';

class NumUtil {
  /// 获取一个随机随
  static int getRandomNumber(int min, int max) {
    Random random = Random();
    int randomNumber = random.nextInt(max - min) + min;
    return randomNumber;
  }

  /// 获取不包括当前的随机数
  static int getRandomNumberExcludingCurrent(int min, int max, int current) {
    int newNumber;
    do {
      newNumber = getRandomNumber(min, max);
    } while (newNumber == current);
    return newNumber;
  }
}
