showProgressDialog function
Future<void>
showProgressDialog(
- BuildContext context, {
- String? message,
- required Color textColor,
- Color? barrierColor = Colors.black54,
- Color? backgroundColor = Colors.white,
- void onPressed()?,
Displays a loading/progress dialog.
message is an optional loading message.
textColor controls the message text color.
barrierColor and backgroundColor style the dialog.
onPressed is an optional callback for additional actions.
Implementation
Future<void> showProgressDialog(
BuildContext context, {
String? message,
required Color textColor,
Color? barrierColor = Colors.black54,
Color? backgroundColor = Colors.white,
void Function()? onPressed,
}) {
return baseDialog(
context,
barrierColor: barrierColor,
backgroundColor: backgroundColor,
content: Row(
children: [
const CircularProgressIndicator(),
Container(
margin: const EdgeInsets.only(left: 12.0),
child: Text(message ?? '', style: TextStyle(color: textColor)),
),
],
),
);
}