getSingleDigitRandomNumber function

String getSingleDigitRandomNumber()

getSingleDigitRandomNumber method this method will return a single digit random number

Implementation

String getSingleDigitRandomNumber() {
  const int min = 1, max = 9;
  final Random rnd = Random.secure();

  final int number = min + rnd.nextInt(max - min);
  debugPrint('generated random single digit number is: $number');

  return number.toString();
}