isListOfString function

bool isListOfString(
  1. Iterable? list
)

Returns true if list elements are all of type String.

Implementation

bool isListOfString(Iterable? list) {
  if (list == null) return false;
  if (list is List<String>) return true;
  if (list.isEmpty) return false;

  if (listNotMatchesAll(list, (e) => (e is String))) return false;

  return true;
}