simple static method
dynamic
simple({
- required BuildContext context,
- required ModalTitle title,
- required ModalButton button,
Shows a simple dialog with a title and a button.
If the color of the button is not defined, it will be #FCE444
by
default.
Implementation
static simple({
required BuildContext context,
required ModalTitle title,
required ModalButton button,
}) {
return showDialog(
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return _BaseAlertDialog(
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Divider(
color: Colors.transparent,
height: 18,
),
Align(
alignment: Alignment.center,
child: Text(
title.text,
textAlign: TextAlign.center,
style: TextStyle(
color: title.color ?? const Color(0xFF303F9F),
fontWeight: FontWeight.w500,
fontSize: 20,
),
),
),
const Divider(
color: Color(0xFFDBDDE0),
height: 36,
),
Align(
alignment: Alignment.center,
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(
button.color ?? const Color(0xFFFCE444),
),
minimumSize: const MaterialStatePropertyAll(
Size(double.infinity, 35),
),
shape:
const MaterialStatePropertyAll<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(6),
),
),
),
),
child: Text(
button.text,
style: TextStyle(
color: button.textColor ?? const Color(0xFF25282B),
fontWeight: FontWeight.bold,
),
),
),
),
],
),
);
},
);
}