Flutter-Progress-Dialog icon indicating copy to clipboard operation
Flutter-Progress-Dialog copied to clipboard

Force complete and set complete msg.

Open Kinwailo opened this issue 2 years ago • 2 comments

Add pd.complete() method can force the progress complete and set the completed parameter, so we can show the complete msg with data only available after the process is completed.

Add autoComplete parameter to pd.show(), so it can work with pd.complete() method by set it to false.

Add step parameter to pd.update(), it will add the value to progress instead of set the value.

Kinwailo avatar Jul 23 '22 17:07 Kinwailo

hello, does the dialog not close when it should? Why did we need to move the completed part as a function?

emreesen27 avatar Jul 24 '22 07:07 emreesen27

Because the completed object is set before the process, so we cannot show processed info on complete. eg. we downloaded a json from server then show some data in json at complete msg.

Kinwailo avatar Jul 24 '22 14:07 Kinwailo

Hello, Sorry for the late reply. I think this problem is solved in 1.1.1

Create Completed

 var c = Completed(completedMsg: "first message");

You can reassign "completedMsg" when the dialog state is complete.

  pd.show(
    max: 100,
    msg: "Preparing Download",
    completed: c,
    onStatusChanged: (status) {
    // When the dialog reaches this state, the download is finished but "completed" is not yet displayed.
      if (status == DialogStatus.completed) {       
          c.completedMsg = "new message";
      }
    },
  );

emreesen27 avatar Jan 21 '23 14:01 emreesen27