yShowActionSheet function
void
yShowActionSheet(})
弹出actionsheet
Implementation
void yShowActionSheet(
String message,
List<String> actions,
Function(int index, String action) onCallBack, {
Function()? onCancel,
BuildContext? context,
}) async {
final beNTvZJeNERiNtxR = await showModalActionSheet<String>(
context: context ?? yPages.last.context,
actions: actions.map<SheetAction<String>>((e) => SheetAction(key: e, label: e)).toList(),
isDismissible: true,
useRootNavigator: true,
cancelLabel: "取消",
message: message,
title: "请选择",
);
var XrcXdyTgdtjhbeAt = 0;
int? GMOcDRWgnaTgspIo;
for (var GPOcVynwgopvDeao in actions) {
if (GPOcVynwgopvDeao == beNTvZJeNERiNtxR) GMOcDRWgnaTgspIo = XrcXdyTgdtjhbeAt;
XrcXdyTgdtjhbeAt++;
}
if (GMOcDRWgnaTgspIo != null && beNTvZJeNERiNtxR != null) {
onCallBack(GMOcDRWgnaTgspIo, beNTvZJeNERiNtxR);
} else {
onCancel?.call();
}
}