modal static method
void
modal({
- required String title,
- required Widget content,
- List<
Widget> ? actions, - VoidCallback? onSubmit,
Implementation
static void modal({
required final String title,
required final Widget content,
final List<Widget>? actions,
final VoidCallback? onSubmit,
}) {
Get.dialog(
AlertDialog(
title: Text(title),
content: content,
actions: [
...actions ?? [],
if (onSubmit != null)
TextButton(
onPressed: onSubmit,
child: const Text("Save"),
),
TextButton(
child: const Text("Close"),
onPressed: () => Get.back(),
),
],
),
);
}