addValue method
Adds new input value to the list
Implementation
void addValue(String value) {
if (!state.lastValues.contains(value) && state.favoriteValue != value) {
final newValues = [value, ...state.lastValues];
if (newValues.length > 2) {
newValues.removeRange(2, newValues.length - 1);
}
if (!isClosed) {
emit(
PersistedInputData(
favoriteValue: state.favoriteValue,
lastValues: newValues,
),
);
}
}
}