Get.defaultDialog(
title: "提示",
middleText: "您确定要清空历史记录吗",
middleTextStyle:
TextStyle(fontSize: ScreenUtils.fontSize(50)),
radius: 10.0,
confirm: ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(Colors.red),
foregroundColor:
MaterialStateProperty.all(Colors.white),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(20))),
),
onPressed: () {
controller.clearHistoryData();
Get.back();
},
child: const Text("确定")),
cancel: ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.all(Colors.yellow),
foregroundColor:
MaterialStateProperty.all(Colors.black54),
shape: MaterialStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20))),
),
onPressed: () {
print("取消");
Get.back();
},
child: const Text("取消"),
),
);