showCustomAlert method
void
showCustomAlert({})
Implementation
void showCustomAlert({
required Widget? body,
Function? onComplete,
bool cancelable = false,
double? cornerRadius,
double paddingScreen = 15,
double? fixedSize,
}) {
hideAlert();
isOpened = true;
showDialog(
barrierDismissible: cancelable,
context: _context,
builder: (BuildContext context) {
return PopScope(
canPop: cancelable,
child: Dialog(
insetPadding: EdgeInsets.all(AwesomeAlertTheme().defaultPaddingAlert ?? paddingScreen),
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(cornerRadius ?? AwesomeAlertTheme().borderRadius)),
),
child: ConstrainedBox(
constraints: (fixedSize != null || AwesomeAlertTheme().fixedSize != null)
? BoxConstraints(maxWidth: fixedSize ?? AwesomeAlertTheme().fixedSize ?? 700)
: BoxConstraints(),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(cornerRadius ?? AwesomeAlertTheme().borderRadius)),
),
child: body,
),
),
),
);
},
).whenComplete(() {
isOpened = false;
if (onComplete != null) onComplete();
});
}