Browse Source

Close dialog after 1 second in success state

ashilkn 2 years ago
parent
commit
d42d024d30
1 changed files with 7 additions and 2 deletions
  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)