setFirst method

void setFirst (
  1. String val
)

Implementation

void setFirst(String val) {
  if (value != null && value.isNotEmpty && value.elementAt(0) != null) {
    if (value.indexOf(val) == -1) {
      value[0] = val;
      notifyListeners();
    } else {
      value[0] = '';
      notifyListeners();
    }
  } else {
    if (value == null) {
      value = [];
    }
    value.insert(0, val);
    notifyListeners();
  }
}