Skip to content

Commit 6abba0e

Browse files
committed
1 parent fb606fd commit 6abba0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

example/lib/sample/components/actionsheet/actionsheet_entry_page.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ class _ActionSheetEntryPageState extends State<ActionSheetEntryPage> {
334334
// 用于控制timer只加载一次
335335
var started = false;
336336
// 计时器
337-
var periodTimer;
337+
Timer periodTimer;
338338
List<BrnCommonActionSheetItem> actions = List();
339339
actions.add(BrnCommonActionSheetItem(
340340
'倒计时:$countdown',
@@ -369,7 +369,7 @@ class _ActionSheetEntryPageState extends State<ActionSheetEntryPage> {
369369
actions[0].desc = '倒计时:$times';
370370
});
371371
} else if (countdown == 0) {
372-
periodTimer.onCancel();
372+
periodTimer.cancel();
373373
}
374374
});
375375
}
@@ -380,15 +380,15 @@ class _ActionSheetEntryPageState extends State<ActionSheetEntryPage> {
380380
BrnCommonActionSheetItem actionEle,
381381
) {
382382
// 点击后立即停止计时
383-
periodTimer.onCancel();
383+
periodTimer.cancel();
384384
var title = actionEle.title;
385385
BrnToast.show("title: $title, index: $index", context);
386386
},
387387
);
388388
});
389389
// then用来在pop折后停止timer,如果不需要在pop后进行操作,不需要使用then
390390
}).then((value) {
391-
periodTimer.onCancel();
391+
periodTimer.cancel();
392392
});
393393
}
394394

0 commit comments

Comments
 (0)