showPopup static method
void
showPopup({})
Implementation
static void showPopup(
{required bool isError,
required BuildContext context,
required Function onClose,
required String buttonTestKey,
required String buttonName,
Function? beforePopup,
String? title,
String? msg}) {
if (_isPopupShowing) return;
_isPopupShowing = true;
if (beforePopup != null) beforePopup();
showDialog(
context: context,
barrierDismissible: false,
builder: (context) {
return AlertDialog(
icon: isError
? TkfIcons.failed(color: kErrorColor)
: TkfIcons.success(),
title: title != null
? Text(title,
style: kTitleStyleDark.copyWith(fontWeight: FontWeight.bold))
: null,
contentPadding:
const EdgeInsets.only(left: 23, right: 23, top: 15, bottom: 15),
content: msg != null
? Text(msg,
style: kTextStyle14o80.copyWith(fontSize: 16),
textAlign: TextAlign.center)
: null,
actions: [
TkfPopUpButton(
testKey: Key(buttonTestKey),
name: buttonName,
onPress: () {
_isPopupShowing = false;
onClose();
},
)
],
);
},
);
}