dlgLoading<T> method
Provides the ability to run an async task and present a wait dialog. It is important you call CodeMeltedUI.dlgClose to properly clear the dialog and return any value expected.
Implementation
Future<T?> dlgLoading<T>({
required String message,
required Future<void> Function() task,
double? height,
String? title,
double? width,
}) async {
Future.delayed(Duration.zero, task);
return dlgCustom<T>(
content: Row(
children: [
const SizedBox(width: 5.0),
SizedBox(
height: 25.0,
width: 25.0,
child: CircularProgressIndicator(
color: _getTheme().contentColor,
),
),
const SizedBox(width: 5.0),
Text(
message,
softWrap: true,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: _getTheme().contentColor),
),
],
),
height: height,
title: title ?? "Please Wait",
width: width,
);
}