SnackBar constructor Null safety

const SnackBar(
  1. {Key? key,
  2. required Widget content,
  3. Color? backgroundColor,
  4. double? elevation,
  5. EdgeInsets? margin,
  6. EdgeInsets? padding,
  7. double? width,
  8. ShapeBorder? shape,
  9. SnackBarBehavior? behavior,
  10. SnackBarAction? action,
  11. bool? showCloseIcon,
  12. Color? closeIconColor,
  13. @Default(Duration(milliseconds: 4000)) Duration duration,
  14. Callback? onVisible,
  15. @Default(DismissDirection.down) DismissDirection dismissDirection,
  16. @Default(Clip.hardEdge) Clip clipBehavior}
)

Implementation

const factory SnackBar({
  Key? key,
  required Widget content,
  Color? backgroundColor,
  double? elevation,
  EdgeInsets? margin,
  EdgeInsets? padding,
  double? width,
  ShapeBorder? shape,
  SnackBarBehavior? behavior,
  SnackBarAction? action,
  bool? showCloseIcon,
  Color? closeIconColor,
  @Default(Duration(milliseconds: 4000)) Duration duration,
  Callback? onVisible,
  @Default(DismissDirection.down) DismissDirection dismissDirection,
  @Default(Clip.hardEdge) Clip clipBehavior,
}) = _SnackBar;