showConfirmDialog function
Shows a confirmation dialog with customizable text and callbacks.
Implementation
Future<void> showConfirmDialog(
BuildContext context, {
required AppTheme theme,
bool dismissible = true,
String? title,
String? message,
String? positiveText,
String? negativeText,
Color? negativeColor,
Color? positiveColor,
void Function()? onNegativePressed,
void Function()? onPositivePressed,
}) {
return showCustomDialog(
context,
theme: theme,
dismissible: dismissible,
backgroundColor: theme.backgroundColor().withValues(alpha: .9),
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
_titleWidget(title, theme.textColor()),
const SizedBox(height: 12.0),
_messageWidget(message, theme.textColor()),
],
),
textColor: theme.textColor(),
color: theme.backgroundColor(),
positiveText: positiveText ?? StringUtils.capitalize(tr('yes')),
negativeText: negativeText ?? StringUtils.capitalize(tr('no')),
negativeColor: negativeColor,
positiveColor: positiveColor,
onNegativePressed: onNegativePressed,
onPositivePressed: onPositivePressed,
);
}