From 06cfcc608ca97fc54476622be2f3dd9a1db9dfc1 Mon Sep 17 00:00:00 2001 From: liny <137387869@qq.com> Date: Wed, 12 Jan 2022 18:11:37 +0800 Subject: [PATCH] fix #71 --- .../components/actionsheet/actionsheet_entry_page.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/example/lib/sample/components/actionsheet/actionsheet_entry_page.dart b/example/lib/sample/components/actionsheet/actionsheet_entry_page.dart index c5847429..315d7668 100644 --- a/example/lib/sample/components/actionsheet/actionsheet_entry_page.dart +++ b/example/lib/sample/components/actionsheet/actionsheet_entry_page.dart @@ -334,7 +334,7 @@ class _ActionSheetEntryPageState extends State { // 用于控制timer只加载一次 var started = false; // 计时器 - var periodTimer; + Timer periodTimer; List actions = List(); actions.add(BrnCommonActionSheetItem( '倒计时:$countdown', @@ -369,7 +369,7 @@ class _ActionSheetEntryPageState extends State { actions[0].desc = '倒计时:$times'; }); } else if (countdown == 0) { - periodTimer.onCancel(); + periodTimer.cancel(); } }); } @@ -380,7 +380,7 @@ class _ActionSheetEntryPageState extends State { BrnCommonActionSheetItem actionEle, ) { // 点击后立即停止计时 - periodTimer.onCancel(); + periodTimer.cancel(); var title = actionEle.title; BrnToast.show("title: $title, index: $index", context); }, @@ -388,7 +388,7 @@ class _ActionSheetEntryPageState extends State { }); // then用来在pop折后停止timer,如果不需要在pop后进行操作,不需要使用then }).then((value) { - periodTimer.onCancel(); + periodTimer.cancel(); }); }