randomQuote function

Quote randomQuote()

Gets a random quote in the form of a Quote object, containing a text and an author

Implementation

Quote randomQuote() {

  if (_quotes.isEmpty) {
    _loadQuotes();
  }

  Random random = Random();
  int randomIndex = random.nextInt(_quotes.length);
  return _quotes[randomIndex];
}