flutter random number code example
Example 1: dart random number
import 'dart:math';
Random random = new Random();
int randomNumber = random.nextInt(100);
Example 2: generate random int dart
import 'dart:math';
var now = new DateTime.now();
Random rnd = new Random();
Random rnd2 = new Random(now.millisecondsSinceEpoch);
void main() {
int min = 13, max = 42;
int r = min + rnd.nextInt(max - min);
print("$r is in the range of $min and $max");
print("${nextInter(min, max)}");
int r2 = min + rnd2.nextInt(max - min); ...
Example 3: flutter random int
import 'dart:math';
main() {
var rng = new Random();
for (var i = 0; i < 10; i++) {
print(rng.nextInt(100));
}
}