showSingleButtonDialog static method
void
showSingleButtonDialog(
- BuildContext context, {
- required String label,
- bool showIcon = false,
- Image? iconWidget,
- String? title,
- Widget? titleWidget,
- String? message,
- Widget? messageWidget,
- String? warning,
- Widget? warningWidget,
- Widget? labelWidget,
- GestureTapCallback? onTap,
- bool barrierDismissible = true,
- int titleMaxLines = cTitleMaxLines,
- DialogConfig? themeData,
展示底部只有一个按钮的对话框 对话框的点击回调是onTap label 底部按钮的文案 labelWidget 自定义底部按钮的显示
Implementation
static void showSingleButtonDialog(
BuildContext context, {
required String label,
bool showIcon = false,
Image? iconWidget,
String? title,
Widget? titleWidget,
String? message,
Widget? messageWidget,
String? warning,
Widget? warningWidget,
Widget? labelWidget,
GestureTapCallback? onTap,
bool barrierDismissible = true,
int titleMaxLines = cTitleMaxLines,
DialogConfig? themeData,
}) {
List<Widget> actionsWidget = [];
if (labelWidget != null) {
actionsWidget.add(labelWidget);
}
showDialog<void>(
context: context,
barrierDismissible: barrierDismissible,
builder: (BuildContext dialogContext) {
return PhoenixDialog(
iconImage: iconWidget,
showIcon: showIcon,
titleText: title,
titleWidget: titleWidget,
messageText: message,
contentWidget: messageWidget,
warningText: warning,
warningWidget: warningWidget,
actionsText: [label],
actionsWidget: actionsWidget,
titleMaxLines: titleMaxLines,
themeData: themeData,
indexedActionCallback: (index) {
if (index == 0) {
if (onTap != null) {
onTap();
}
}
},
);
},
);
}