getRandomChar method

String getRandomChar()

Returns a random character from this string.

Implementation

String getRandomChar() {
  if (isEmpty) return '';
  final int index = DateTime.now().microsecondsSinceEpoch % length;
  return this[index];
}