setDropDown method

void setDropDown(
  1. List<DropDownValueModel>? modelList
)

Implementation

void setDropDown(List<DropDownValueModel>? modelList) {
  List<DropDownValueModel>? lst;
  if (modelList != null && modelList.isNotEmpty) {
    List<DropDownValueModel> list = [];
    for (DropDownValueModel item in modelList) {
      if (!list.contains(item)) {
        list.add(item);
      }
    }
    lst = list;
  }
  Function unOrdDeepEq = const DeepCollectionEquality.unordered().equals;

  if (!unOrdDeepEq(lst, dropDownValueList)) {
    dropDownValueList = lst;
    notifyListeners();
  }
}