showSimple<T> static method
Future<T?>
showSimple<T>({
- required BuildContext context,
- required List<
Widget> children, - Widget? title,
- EdgeInsetsGeometry titlePadding = const EdgeInsets.fromLTRB(14, 18, 14, 0),
- TextStyle? titleTextStyle,
- EdgeInsetsGeometry contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
- Color? backgroundColor,
- double? elevation,
- Color? shadowColor,
- Color? surfaceTintColor,
- String? semanticLabel,
- EdgeInsets insetPadding = const EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
- Clip clipBehavior = Clip.none,
- ShapeBorder? shape,
- AlignmentGeometry? alignment,
简单对话框
Implementation
static Future<T?> showSimple<T>({
/// 上下文
required BuildContext context,
/// 子组件列表
required List<Widget> children,
/// 标题组件
Widget? title,
/// 标题内边距
EdgeInsetsGeometry titlePadding = const EdgeInsets.fromLTRB(14, 18, 14, 0),
/// 标题文本样式
TextStyle? titleTextStyle,
/// 内容内边距
EdgeInsetsGeometry contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
/// 背景色
Color? backgroundColor,
/// 阴影高度
double? elevation,
/// 阴影颜色
Color? shadowColor,
/// 表面色调
Color? surfaceTintColor,
/// 语义标签
String? semanticLabel,
/// 对话框边距
EdgeInsets insetPadding = const EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
/// 裁剪方式
Clip clipBehavior = Clip.none,
/// 形状
ShapeBorder? shape,
/// 对齐方式
AlignmentGeometry? alignment,
}) {
return showDialog<T>(
context: context,
builder: (context) => SimpleDialog(
title: title,
titlePadding: titlePadding,
titleTextStyle: titleTextStyle,
contentPadding: contentPadding,
backgroundColor: backgroundColor,
elevation: elevation,
shadowColor: shadowColor,
surfaceTintColor: surfaceTintColor,
semanticLabel: semanticLabel,
insetPadding: insetPadding,
clipBehavior: clipBehavior,
shape: shape,
alignment: alignment,
children: children,
),
);
}