cShowAlwaysOnTopAlert function
void
cShowAlwaysOnTopAlert({})
Implementation
void cShowAlwaysOnTopAlert({
required BuildContext context,
required String message,
String? title,
String? okText,
Function()? ok,
String? cancelText,
Function()? cancel,
double width = 400,
}) {
if (cAlertOverlayEntry != null) {
// If an alert is already being shown, remove it first
cAlertOverlayEntry!.remove();
}
cAlertOverlayEntry = OverlayEntry(
builder: (context) => TopAlert(
message: message,
title: title,
ok: ok,
okText: okText,
cancelText: cancelText,
cancel: cancel,
width: width,
),
);
// Insert the overlay entry into the overlay
Overlay.of(context).insert(cAlertOverlayEntry!);
}