Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

selecting a particular sublist in list in dart

import "dart:math";

var list = ['a','b','c','d','e'];

// generates a new Random object
final _random = new Random();

// generate a random index based on the list length
// and use it to retrieve the element
var element = list[_random.nextInt(list.length)];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #selecting #sublist #list #dart
ADD COMMENT
Topic
Name
6+5 =