ToastrValidator class
Utility class for validating toastr configurations and inputs with security
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createSecureConfig(
{required ToastrType type, required String message, String? title, Duration? duration, ToastrConfig? baseConfig}) → ToastrConfig - Creates a secure configuration from user input
-
getRecommendedDuration(
String message, ToastrType type) → Duration - Gets the recommended duration based on message length and type
-
isValidAnimationDuration(
Duration duration) → bool - Validates animation durations for security
-
isValidConfig(
ToastrConfig config) → bool - Validates if a ToastrConfig is properly configured with security checks
-
isValidMessage(
String message) → bool - Validates if a message string is acceptable for toastr
-
isValidTitle(
String? title) → bool - Validates if a title string is acceptable for toastr
-
logSecurityEvent(
String event, String details) → void - Security audit log entry for suspicious activity
-
sanitizeHtml(
String input) → String - Sanitiza texto para prevenir XSS
-
sanitizeMessage(
String message) → String - Sanitizes a message string by trimming and limiting length with security Sanitiza un mensaje
-
sanitizeTitle(
String? title) → String? - Sanitizes a title string by trimming and limiting length with security