alert static method
Future
alert({
- String? title,
- List<
TextButton> ? actions, - bool showCancel = true,
- bool barrierDismissible = true,
Implementation
static Future<dynamic> alert({
String? title,
String? caption,
List<TextButton>? actions,
bool showCancel = true,
bool barrierDismissible = true,
}) {
return showDialog(
context: context,
barrierDismissible: barrierDismissible,
builder: (_) {
return AlertDialog(
titlePadding:
const EdgeInsets.all(16).copyWith(bottom: 8, top: 20),
actionsPadding: const EdgeInsets.all(16).copyWith(bottom: 8),
contentPadding: const EdgeInsets.symmetric(horizontal: 16),
title: title?.style(weight: FontWeight.w700, size: 18),
content: caption?.style(),
actions: [
if (showCancel)
TextButton(
onPressed: () => context.back(false),
child: 'Kapat'.style(selectable: false)),
if (actions != null)
for (var a in actions) a,
]);
});
}