How do I generate random numbers using Dart?
try this, you can control the min/max value :
import 'dart:math'; void main(){ random(min, max){ var rn = new Random(); return min + rn.nextInt(max - min); } print(random(5,20)); // Output : 19, 6, 15.. }