concatenateWithArrow function

String? concatenateWithArrow(
  1. List<String?> strings
)

Implementation

String? concatenateWithArrow(List<String?> strings) {
  List<String> nonNullStrings = strings.where((element) => element != null)
      .cast<String>()
      .toList();

  if (nonNullStrings.isEmpty) {
    return null;
  }

  return nonNullStrings.join("->");
}