showSimple<T> static method

Future<T?> showSimple<T>({
  1. required BuildContext context,
  2. required List<Widget> children,
  3. Widget? title,
  4. EdgeInsetsGeometry titlePadding = const EdgeInsets.fromLTRB(14, 18, 14, 0),
  5. TextStyle? titleTextStyle,
  6. EdgeInsetsGeometry contentPadding = const EdgeInsets.fromLTRB(0.0, 12.0, 0.0, 16.0),
  7. Color? backgroundColor,
  8. double? elevation,
  9. Color? shadowColor,
  10. Color? surfaceTintColor,
  11. String? semanticLabel,
  12. EdgeInsets insetPadding = const EdgeInsets.symmetric(horizontal: 40.0, vertical: 24.0),
  13. Clip clipBehavior = Clip.none,
  14. ShapeBorder? shape,
  15. 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,
    ),
  );
}