Check out example codes for "how to return a random number from a list in dart". It will help you in understanding the concepts better.

Code Example 1

import "dart:math";

void main() {
 var list = ['a','b','c','d'];
    var element = getRandomElement(list);

T getRandomElement<T>(List<T> list) {
    final random = new Random();
    var i = random.nextInt(list.length);
    return list[i];

Learn ReactJs, React Native from