lorem function

dynamic lorem(
  1. int words
)

Implementation

lorem(int words) {
  final split = _text.split(" ");
  final w = List.of(split);
  while (words > w.length) {
    w.addAll(List.of(split));
  }
  final res = w.take(words).toList();
  if (res.isNotEmpty) res.last = res.last.replaceAll(",", ".");
  return res.join(" ");
}