浏览代码

Close dialog after 1 second in success state

ashilkn 2 年之前
父节点
当前提交
d42d024d30
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      lib/ui/components/button_widget.dart

+ 7 - 2
lib/ui/components/button_widget.dart

@@ -421,8 +421,13 @@ class _ButtonChildWidgetState extends State<ButtonChildWidget> {
           setState(() {
             executionState = ExecutionState.successful;
             Future.delayed(
-                Duration(seconds: widget.shouldSurfaceExecutionStates ? 2 : 0),
-                () {
+                Duration(
+                  seconds: widget.isInAlert
+                      ? 1
+                      : widget.shouldSurfaceExecutionStates
+                          ? 2
+                          : 0,
+                ), () {
               widget.isInAlert
                   ? Navigator.of(context, rootNavigator: true)
                       .pop(widget.buttonAction)