Language:

Search

How to Generate Random Numbers in Dart

  • Share this:
post-title

Import "dart:math", use Random class

import 'dart:math';
main() {
  var range = Random();
  for (var i = 0; i < 10; i++) {
    print(range.nextInt(100));
  }
}
Ammar Javed

Ammar Javed

Still Learning | Still Searching | Still Exploring | The secret of your success is determined by your daily agenda.