xiaodong 5 years ago
commit 19c6f910e7

@ -174,7 +174,7 @@ class ItemContainerState extends State<ItemContainer> {
/** /**
* item * item
*/ */
void refreshItem() { void refreshItem(bool v) {
/** /**
Exception caught by gesture Exception caught by gesture
The following assertion was thrown while handling a gesture: The following assertion was thrown while handling a gesture:
@ -182,7 +182,7 @@ class ItemContainerState extends State<ItemContainer> {
*/ */
if (mounted) { if (mounted) {
setState(() { setState(() {
dateModel.isSelected = !dateModel.isSelected; dateModel.isSelected = v;
// isSelected.value = !isSelected.value; // isSelected.value = !isSelected.value;
}); });
} }
@ -237,12 +237,11 @@ class ItemContainerState extends State<ItemContainer> {
//item //item
if (calendarProvider.lastClickItemState != this) { if (calendarProvider.lastClickItemState != this) {
calendarProvider.lastClickItemState?.refreshItem(); calendarProvider.lastClickItemState?.refreshItem(false);
calendarProvider.lastClickItemState = this; calendarProvider.lastClickItemState = this;
} }
} }
refreshItem(!this.dateModel.isSelected);
refreshItem();
}, },
child: configuration.dayWidgetBuilder(dateModel), child: configuration.dayWidgetBuilder(dateModel),
); );

@ -10,7 +10,7 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
provider: ^3.1.0+1 provider: ^4.0.4
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter

Loading…
Cancel
Save