Skip to content

Commit 7f45e08

Browse files
committed
🐛 修复infobar延时
1 parent 8b7fc73 commit 7f45e08

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

lib/ui/bt_infobar.dart

+10-5
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,19 @@ class BtInfobarQueue extends ChangeNotifier {
3737

3838
/// 刷新
3939
Future<void> fresh() async {
40+
if (queue.length == 1) {
41+
await queue.first.show();
42+
queue.removeAt(0);
43+
notifyListeners();
44+
}
4045
timer = Timer.periodic(Duration(seconds: 3), (timer) async {
41-
if (queue.isNotEmpty) {
42-
await queue.first.show();
43-
queue.removeAt(0);
44-
notifyListeners();
45-
} else {
46+
if (queue.isEmpty) {
4647
timer.cancel();
48+
return;
4749
}
50+
await queue.first.show();
51+
queue.removeAt(0);
52+
notifyListeners();
4853
});
4954
}
5055

0 commit comments

Comments
 (0)