From 59256033b6e1f3010ea79aee910b936e87ec2269 Mon Sep 17 00:00:00 2001 From: zileyuan Date: Mon, 3 Feb 2020 17:27:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8D=95=E9=80=89?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E5=8F=AF=E4=BB=A5=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/widget/month_view.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/widget/month_view.dart b/lib/widget/month_view.dart index bdbafd7..e7b503d 100644 --- a/lib/widget/month_view.dart +++ b/lib/widget/month_view.dart @@ -174,7 +174,7 @@ class ItemContainerState extends State { /** * 提供方法给外部,可以调用这个方法进行刷新item */ - void refreshItem() { + void refreshItem(bool v) { /** Exception caught by gesture The following assertion was thrown while handling a gesture: @@ -182,7 +182,7 @@ class ItemContainerState extends State { */ if (mounted) { setState(() { - dateModel.isSelected = !dateModel.isSelected; + dateModel.isSelected = v; // isSelected.value = !isSelected.value; }); } @@ -237,12 +237,11 @@ class ItemContainerState extends State { //单选需要刷新上一个item if (calendarProvider.lastClickItemState != this) { - calendarProvider.lastClickItemState?.refreshItem(); + calendarProvider.lastClickItemState?.refreshItem(false); calendarProvider.lastClickItemState = this; } } - - refreshItem(); + refreshItem(!this.dateModel.isSelected); }, child: configuration.dayWidgetBuilder(dateModel), ); From f55b502b6619f2dff6c1ec30cd41b6af206ab4fb Mon Sep 17 00:00:00 2001 From: zileyuan Date: Wed, 12 Feb 2020 18:07:13 +0800 Subject: [PATCH 2/2] update provider --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 8d075d6..b96cb8a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: flutter: sdk: flutter - provider: ^3.1.0+1 + provider: ^4.0.4 dev_dependencies: flutter_test: sdk: flutter