unique<T> static method

List<T> unique<T>(
  1. List<T>? q1, [
  2. List<T>? q2
])

unique for int, String, double List

Implementation

static List<T> unique<T>(List<T>? q1, [List<T>? q2]) {
  if (isEmpty(q1) && isEmpty(q2)) {
    return <T>[];
  }
  List<T> arr = q1 ?? [];
  arr.addAll(q2 ?? []);
  if (T != int &&
      T != String &&
      T != double &&
      arr.first is int &&
      arr.first is String &&
      arr.first is double) {
    return arr;
  }
  return Set<T>.from(arr).toList();
}