showProgressDialogBox static method
Displays a non-dismissible progress dialog with a custom message.
Shows a loading dialog containing a circular progress indicator and custom text.
The dialog cannot be dismissed by tapping outside (barrierDismissible: false)
and must be closed programmatically using Get.back().
Parameters:
text: The message to display below the progress indicator (required)
Example:
// Show progress dialog
RtCommonFunction.showProgressDialogBox(text: 'Uploading data...');
// Perform long-running operation
await uploadData();
// Dismiss dialog
Get.back();
See also:
- showMaterialDialog for a simpler loading dialog
- updateProgressDialogBox for updating progress percentage
Implementation
static void showProgressDialogBox({required String text}) {
WidgetsBinding.instance.addPostFrameCallback((_) {
Get.dialog(
AlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircularProgressIndicator(), // Display a loading indicator
SizedBox(height: Utils.appConstants.ten),
Text(text), // Display a message
],
),
),
barrierDismissible:
false, // Prevent dismissing the dialog by tapping outside
);
});
}