From ce3af288f4a780fce2ccc24365ef42298f377273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=91=86=E5=91=86666?= Date: Sat, 9 Nov 2024 23:29:12 +0800 Subject: [PATCH] optimize attach feature --- lib/src/widget/helper/attach_widget.dart | 5 ++++- pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/src/widget/helper/attach_widget.dart b/lib/src/widget/helper/attach_widget.dart index 93e3111..5b5c844 100644 --- a/lib/src/widget/helper/attach_widget.dart +++ b/lib/src/widget/helper/attach_widget.dart @@ -95,7 +95,10 @@ class _AttachWidgetState extends State @override void didChangeMetrics() { super.didChangeMetrics(); - _resetState(); + // The latency threshold is approximately 8 milliseconds + Future.delayed(const Duration(milliseconds: 30), () { + _resetState(); + }); } @override diff --git a/pubspec.yaml b/pubspec.yaml index 100f196..15ebe00 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: An elegant Flutter Dialog solution, Easily implement Toast, Loading and custom Dialog, Make the use of the dialog easier! -version: 4.9.8+4 +version: 4.9.8+5 homepage: https://github.com/fluttercandies/flutter_smart_dialog # flutter pub publish --server=https://pub.dartlang.org # flutter build web --release --base-href="/flutter_smart_dialog/web/"