commonAlertDialog function
Implementation
Widget commonAlertDialog(BuildContext context, String title, Widget content) {
final dialogTheme = Theme.of(context).dialogTheme; // Get theme
return AlertDialog(
// backgroundColor: dialogTheme.backgroundColor ?? Colors.white,
shape:
dialogTheme.shape ??
RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
title: Text(
title,
style:
dialogTheme.titleTextStyle ??
const TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
),
content: content,
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(HyttaHubLocalizations.of(context)!.okButton),
),
],
);
}