by @kodeazy
flutter How to get random number up till specific range in dart file?
- In this blog we will discuss on how to generate a
random
number uptill specific range in flutter. - To gnerate a
random
number weimport
dart:math
which containsRandom
class. -
Below is the sample program of generating a random number uptill
9
.import 'dart:math'; void main() { var rand = new Random(); print(rand.nextInt(10)); }
Output:
9