Skip to content

Instantly share code, notes, and snippets.

@muchirijane
Created September 9, 2019 11:32
Show Gist options
  • Save muchirijane/40ee24d7f35c5ed8eb9d6fcfc7c0fc4b to your computer and use it in GitHub Desktop.
Save muchirijane/40ee24d7f35c5ed8eb9d6fcfc7c0fc4b to your computer and use it in GitHub Desktop.
This is an example of how you can generate random numbers in Dart.
//This is how to generate a rondom number in Dart
// The integer will be from 1 - 6 since i added (+1)
import 'dart:math';
void main() {
int randomNumber = Random().nextInt(6) + 1;
print(randomNumber);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment