Skip to content

Instantly share code, notes, and snippets.

@kumar-aakash86
Last active July 28, 2020 14:43
Show Gist options
  • Save kumar-aakash86/4e9ebbb61cafa08ef374d0e7db18284b to your computer and use it in GitHub Desktop.
Save kumar-aakash86/4e9ebbb61cafa08ef374d0e7db18284b to your computer and use it in GitHub Desktop.
Dart Generate Function - Random Numbers
// Copyright 2015 the Dart project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file.
import 'dart:math';
void main() {
var random = Random();
List<int> numberList = List<int>.generate(10, (i) => random.nextInt(100));
numberList.forEach(print);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment