show method
void
show()
Implementation
void show() async {
await showDialog(
context: context,
builder: (ctx) => AlertDialog(
key: UniqueKey(),
clipBehavior: Clip.antiAliasWithSaveLayer,
contentPadding: contentPadding,
titlePadding: EdgeInsets.zero,
title: (showClose ?? false)
? Flex(
direction: Axis.horizontal,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
IconButton(
onPressed: () {
isShowing = false;
onClose?.call();
ctx.closeDialog;
},
icon: Icon(
Icons.close_rounded,
color: Theme.of(context).cardColor,
))
],
)
: null,
elevation: elevation,
backgroundColor: backgroundColor,
content: RawKeyboardListener(
focusNode: FocusNode(),
autofocus: true,
onKey: (val) {
if (val.isKeyPressed(LogicalKeyboardKey.escape) && (showClose ?? false)) {
context.closeDialog;
}
},
child: child!,
),
),
barrierDismissible: (barrierDismissible ?? false),
useSafeArea: true);
}