This repository was archived by the owner on Nov 24, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 134
PD not getting dismissed some times #80
Comments
It's because the pDialog is trying to hide itself when the dialog is not shown completely. Some workaround you can wait to 200ms when the dialog failed to hide itself. static Future dismissProgressBar() async {
|
please use await |
Hi! I'm having the same issue, but I'm using the await keyword. await state.progress.fold<Future>(
() => _downloadDialog.hide(),
(progress) => _downloadDialog
.show()
.then((_) => _downloadDialog.update(progress: progress)),
);
log('showing: ${_downloadDialog.isShowing()}'); The log is printing OBS: The code above is being called in a BLoC listener (which is called multiple times). |
Same issue here on Android |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
When dealing with Asuncións method, showing PD with Util class across app.
To Reproduce
Calling update record async Firestore method and showing Updating PD and post method calling Util.dismissProgressBar(). Please refer the code:
Util Class code :
Code :
static showProgressBar(BuildContext context, String message) async {
if(pDialog == null) {
pDialog = ProgressDialog(context,
type: ProgressDialogType.Normal,
isDismissible: false,
showLogs: true);
}
pDialog.style(message: message);
await pDialog.show();
}
static Future dismissProgressBar() async {
if (pDialog != null && pDialog.isShowing()) {
return pDialog.hide();
}
}
Calling Class Code:
try {
NetworkManager().updateChild(updatedChild).then((value) {
if (_profileImageStatus == AppConstants.profileImageUpdated) {
uploadFile(updatedChild).then((value) {
Util.dismissProgressBar().then((value) {
if (this.mounted) this.setState(() {});
});
});
} else {
//loggedUser = value;
Util.dismissProgressBar().then((value) {
if (this.mounted) this.setState(() {});
});
}
});
} catch (e) {
Fimber.e(e.toString());
}
Expected behavior
PD should get dismissed every time post method complete
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Flutter 1.20
Smartphone (please complete the following information):
Simulator Nexus 6P
Additional context
The text was updated successfully, but these errors were encountered: