SmartStateSnackbarConfig constructor

const SmartStateSnackbarConfig({
  1. SnackbarPosition position = SnackbarPosition.bottom,
  2. SnackBarBehavior behavior = SnackBarBehavior.fixed,
  3. Duration duration = const Duration(seconds: 3),
  4. bool showCloseIcon = false,
  5. Color? closeIconColor,
  6. EdgeInsets? margin,
  7. EdgeInsets? padding,
  8. double? width,
  9. DismissDirection dismissDirection = DismissDirection.down,
  10. SnackbarStateConfig errorConfig = const SnackbarStateConfig(backgroundColor: Color(0xFFD32F2F), textColor: Colors.white, icon: Icons.error_outline),
  11. SnackbarStateConfig successConfig = const SnackbarStateConfig(backgroundColor: Color(0xFF388E3C), textColor: Colors.white, icon: Icons.check_circle_outline),
  12. SnackbarStateConfig loadingConfig = const SnackbarStateConfig(backgroundColor: Color(0xFF1976D2), textColor: Colors.white, icon: Icons.info_outline),
  13. VoidCallback? onTap,
  14. VoidCallback? onVisible,
})

Implementation

const SmartStateSnackbarConfig({
  this.position = SnackbarPosition.bottom,
  this.behavior = SnackBarBehavior.fixed,
  this.duration = const Duration(seconds: 3),
  this.showCloseIcon = false,
  this.closeIconColor,
  this.margin,
  this.padding,
  this.width,
  this.dismissDirection = DismissDirection.down,
  this.errorConfig = const SnackbarStateConfig(
    backgroundColor: Color(0xFFD32F2F),
    textColor: Colors.white,
    icon: Icons.error_outline,
  ),
  this.successConfig = const SnackbarStateConfig(
    backgroundColor: Color(0xFF388E3C),
    textColor: Colors.white,
    icon: Icons.check_circle_outline,
  ),
  this.loadingConfig = const SnackbarStateConfig(
    backgroundColor: Color(0xFF1976D2),
    textColor: Colors.white,
    icon: Icons.info_outline,
  ),
  this.onTap,
  this.onVisible,
});