How do I generate random numbers using Dart?
Use Random class from dart:math:
dart:math
import 'dart:math'; main() { var rng = new Random(); for (var i = 0; i < 10; i++) { print(rng.nextInt(100)); } }
This code was tested with the Dart VM and dart2js, as of the time of this writing.