pickAction static method

Future<XAction?> pickAction(
  1. List<XAction> items, {
  2. String? title,
  3. XAction? selected,
  4. Widget onItemView(
    1. XAction
    )?,
  5. Widget? onTitle(
    1. XAction
    )?,
  6. Widget? onSubtitle(
    1. XAction
    )?,
  7. Widget? onLeading(
    1. XAction
    )?,
  8. Widget? onTrailing(
    1. XAction
    )?,
  9. List<Widget>? aboveWidgets,
  10. List<Widget>? belowWidgets,
  11. DialogWidth? width,
  12. bool withOKCancel = false,
})

Implementation

static Future<XAction?> pickAction(
  List<XAction> items, {
  String? title,
  XAction? selected,
  Widget Function(XAction)? onItemView,
  Widget? Function(XAction)? onTitle,
  Widget? Function(XAction)? onSubtitle,
  Widget? Function(XAction)? onLeading,
  Widget? Function(XAction)? onTrailing,
  List<Widget>? aboveWidgets,
  List<Widget>? belowWidgets,
  DialogWidth? width,
  bool withOKCancel = false,
}) async {
  XAction? sel = selected ?? items.firstOr((e) => e.checked);

  XAction? ac = await pickValue(
    items,
    title: title,
    selected: sel,
    onItemView: onItemView,
    onTitle: onTitle ?? (a) => a.titleWidget,
    onLeading: onLeading ?? (a) => a.iconWidget,
    onSubtitle: onSubtitle,
    onTrailing: onTrailing,
    aboveWidgets: aboveWidgets,
    belowWidgets: belowWidgets,
    width: width,
    withOKCancel: withOKCancel,
  );
  ac?.onclick();
  return ac;
}