我有一个StatefulWidget,并且有一个属性:
Set<Category> selectedCategories = SplayTreeSet((a,b) => a.label.compareTo(b.label));
我想添加一些东西,但是出现范围错误:
void removeSelectedCategory(Category category) {
this.setState(() {
this.selectedCategories.remove(category);
}
}