Closed PLynx01 closed 8 months ago
You're modifying the previous list before submitting a new one.
Rather than:
void setFrequencyPreset(int optionIndex, FrequencyPresetModel? preset) {
options[optionIndex].frequencyPreset = preset;
options = [...options];
notifyListeners();
}
You may want:
void setFrequencyPreset(int optionIndex, FrequencyPresetModel? preset) {
options = [...options];
options[optionIndex].frequencyPreset = preset;
notifyListeners();
}
The order matters.
Describe the bug When using the Selector of the List, the shouldUpdate Selector method returns the same previous and next values, even though the List was overwrittten by the modified version.
Expected behavior The changes in List should return the different previous and next values, whith the changes in list
This works when adding entries to the list (the previous and next values are different):
But this doesn't work when modyfying the list (previous and next are the same)
And doing this when removing the entries, also doesn't work (previous and next are the same)
Here is the Selector class from my project:
Could someone help me out?