how to get sublist from list in dart flutter code example
Example 1: 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)];
Example 2: selecting a particular sublist in list in dart
var randomItem = (list.toList()..shuffle()).first;