infoDialog static method
Future<void>
infoDialog({
- required BuildContext buildContext,
- required String title,
- required String message,
- String buttonText = 'OK',
Exibe um diálogo de informação simples
Parâmetros:
buildContext
: Contexto do widgettitle
: Título do diálogomessage
: Mensagem a ser exibidabuttonText
: Texto do botão (padrão: "OK")
Implementation
static Future<void> infoDialog({
required BuildContext buildContext,
required String title,
required String message,
String buttonText = 'OK',
}) async {
final theme = SyncThemeProvider.current;
await showDialog(
context: buildContext,
builder: (context) => AlertDialog(
backgroundColor: theme.surface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(theme.borderRadius),
),
title: Text(
title,
style: theme.titleStyle,
),
content: Text(
message,
style: theme.bodyStyle,
),
actions: [
ElevatedButton(
onPressed: () => Navigator.of(context).pop(),
style: ElevatedButton.styleFrom(
backgroundColor: theme.primary,
foregroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(theme.borderRadius),
),
),
child: Text(
buttonText,
style: theme.buttonStyle,
),
),
],
),
);
}