showMoreButtonDialog static method

void showMoreButtonDialog(
  1. BuildContext context, {
  2. required List<String> actions,
  3. bool showIcon = false,
  4. Image? iconWidget,
  5. String? title,
  6. Widget? titleWidget,
  7. String? message,
  8. Widget? messageWidget,
  9. String? warning,
  10. Widget? warningWidget,
  11. List<Widget>? actionsWidget,
  12. bool barrierDismissible = true,
  13. int titleMaxLines = cTitleMaxLines,
  14. DialogConfig? themeData,
  15. DialogIndexedActionClickCallback? indexedActionClickCallback,
})

展示底部按钮为多个的dialog 如果设置的是文字按钮那么,每个按钮的点击通过indexedActionClickCallback处理 如果底部按钮的数量小于等于2 ,会以横排展示,否则会议竖排展示 如果数量超过了三个 会滑动展示

Implementation

static void showMoreButtonDialog(
  BuildContext context, {
  required List<String> actions,
  bool showIcon = false,
  Image? iconWidget,
  String? title,
  Widget? titleWidget,
  String? message,
  Widget? messageWidget,
  String? warning,
  Widget? warningWidget,
  List<Widget>? actionsWidget,
  bool barrierDismissible = true,
  int titleMaxLines = cTitleMaxLines,
  DialogConfig? themeData,
  DialogIndexedActionClickCallback? indexedActionClickCallback,
}) {
  showDialog<void>(
    context: context,
    barrierDismissible: barrierDismissible,
    builder: (BuildContext dialogContext) {
      return PhoenixDialog(
          iconImage: iconWidget,
          showIcon: showIcon,
          titleText: title,
          titleWidget: titleWidget,
          messageText: message,
          contentWidget: messageWidget,
          warningWidget: warningWidget,
          warningText: warning,
          actionsText: actions,
          actionsWidget: actionsWidget,
          themeData: themeData,
          titleMaxLines: titleMaxLines,
          indexedActionCallback: indexedActionClickCallback);
    },
  );
}