confirm<T> method
Future<T?>
confirm<
T>({ - String? title,
- String? content,
- String? lottiePath,
- String? labelNoButton,
- dynamic onNoClicked()?,
- String? labelYesButton,
- required dynamic onYesClicked()?,
- Widget? customWidget,
- bool isBackAfterYes = true,
})
Implementation
Future<T?> confirm<T>({
String? title,
String? content,
String? lottiePath,
String? labelNoButton,
Function()? onNoClicked,
String? labelYesButton,
required Function()? onYesClicked,
Widget? customWidget,
bool isBackAfterYes = true,
}) async {
// await GetxFire.progressHud.hide();
return await showAnimatedDialog(
context: Get.context!,
barrierDismissible: true,
animationType: animationType,
curve: Curves.fastOutSlowIn,
duration: const Duration(milliseconds: 500),
builder: (_) => ConfirmDialog(
title: title,
content: content,
lottiePath: lottiePath,
labelLeftButton: labelNoButton,
customWidget: customWidget,
onLeftPressed: () {
Get.back();
if (onNoClicked != null) onNoClicked();
},
labelRightButton: labelYesButton,
onRightPressed: () {
if (isBackAfterYes) Get.back();
if (onYesClicked != null) onYesClicked();
},
),
);
}