MuqSnackbar constructor

MuqSnackbar({
  1. required BuildContext context,
  2. Duration duration = const Duration(seconds: 4),
  3. MuqPosition position = MuqPosition.top,
  4. bool autoDismiss = true,
  5. String? title,
  6. String? content,
  7. Duration animationDuration = const Duration(milliseconds: 500),
  8. Curve? animationCurve,
  9. WidgetBuilder? builder,
  10. BorderRadiusGeometry? borderRadius,
  11. Color? backgroundColor = Colors.white,
  12. BorderSide? border,
  13. Widget? leading,
  14. Widget? trailing,
  15. List<BoxShadow>? shadows,
  16. EdgeInsetsGeometry? padding = const EdgeInsets.all(16),
  17. EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(horizontal: 16),
  18. CloseBuilder? closeBuilder,
})

Constructor of MuqSnackbar

Implementation

MuqSnackbar({
  required this.context,
  this.duration = const Duration(seconds: 4),
  this.position = MuqPosition.top,
  this.autoDismiss = true,
  this.title,
  this.content,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationCurve,
  this.builder,
  this.borderRadius,
  this.backgroundColor = Colors.white,
  this.border,
  this.leading,
  this.trailing,
  this.shadows,
  this.padding = const EdgeInsets.all(16),
  this.margin = const EdgeInsets.symmetric(horizontal: 16),
  this.closeBuilder,
})  : assert(duration.inMilliseconds > animationDuration.inMilliseconds),
      assert((content != null) || builder != null,
          'If content are null, builder cannot be null. If builder is null, title and content cannot be null.') {
  _show();
}