Flutter-Progress-Dialog
Flutter-Progress-Dialog copied to clipboard
Force complete and set complete msg.
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.
hello, does the dialog not close when it should? Why did we need to move the completed part as a function?
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.
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";
}
},
);