accept static method

DialogAction accept({
  1. required String title,
  2. dynamic action()?,
  3. bool close = true,
})

创建绿色确认操作按钮

title 按钮显示文本 action 点击回调函数(可选) close 点击后是否关闭对话框(默认true)

Implementation

static DialogAction accept(
    {required String title, Function()? action, bool close = true}) {
  return DialogAction(
    title: title,
    color: Colors.green,
    action: action,
    close: close,
  );
}