joinOrNull function

String? joinOrNull(
  1. Iterable<String?>? items, {
  2. String separator = " ",
})

Implementation

String? joinOrNull(Iterable<String?>? items, {String separator = " "}) {
  if (items?.isNotEmpty == true) {
    return items!.join(separator);
  } else {
    return null;
  }
}