QuickAlert
QuickAlert copied to clipboard
Support for Dynamic Component Updates
Describe the bug
It is not currently possible to dynamically update components (e.g., progress bars or percentage text) inside the QuickAlert dialog. Since QuickAlert.show does not return a widget or expose mechanisms to refresh its child widget tree, dynamic updates during operations like file downloads are not reflected in the UI.
To Reproduce
Steps to reproduce the behavior:
- Attempt to display a
QuickAlertdialog for an operation (e.g., a file download). - Add a child widget inside the
QuickAlertdialog, such as aLinearProgressIndicator, and try to update its state dynamically. - Observe that the UI does not refresh or reflect changes to the widget’s state.
Minimal example:
QuickAlert.show(
context: context,
type: QuickAlertType.custom,
title: 'Downloading...',
text: 'This might take a few minutes. Please do not close the app.',
widget: Column(
children: [
const SizedBox(height: 10),
StatefulBuilder(builder: (context, setState) {
return Column(
children: [
LinearProgressIndicator(value: progress), // progress updates externally
const SizedBox(height: 10),
Text('${(progress * 100).toStringAsFixed(1)}% completed'),
],
);
}),
],
),
showCancelBtn: false,
);
Behavior:
The LinearProgressIndicator and the Text do not update as the progress value changes.
Expected behavior:
QuickAlert should allow updating its child widgets dynamically, providing a way to reflect state changes during long-running operations like file downloads.