by Luiz Mello
@luizmellodevA fully-featured snackbar/toast notification component with multiple types (success, error, warning, info), customizable positions (top/bottom), actions, and animations. Includes a global SnackbarManager for app-wide notifications.
public enum SnackbarType {
case success
case error
case warning
case info
case custom(backgroundColor: Color, iconColor: Color)
var backgroundColor: Color {
switch self {
case .success: return .green
case .error: return .red
case .warning: return .orange
case .info: return .blue
case .custom(let backgroundColor, _): return backgroundColor
}
}
var iconColor: Color {
switch self {
case .success, .error, .warning, .info: return .white
// ... (click "Show full code" to see more)