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 uSSxqroAYAmcfXVK = 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 dhEPSjSnQaKwopId = 0;
int? NNXcrzbpVmOnMJwo;
for (var goIKXPTMoprpCHIH in actions) {
if (goIKXPTMoprpCHIH == uSSxqroAYAmcfXVK) NNXcrzbpVmOnMJwo = dhEPSjSnQaKwopId;
dhEPSjSnQaKwopId++;
}
if (NNXcrzbpVmOnMJwo != null && uSSxqroAYAmcfXVK != null) {
onCallBack(NNXcrzbpVmOnMJwo, uSSxqroAYAmcfXVK);
} else {
onCancel?.call();
}
}