getRecommendedDuration static method
Gets the recommended duration based on message length and type
Implementation
static Duration getRecommendedDuration(String message, ToastrType type) =>
Duration(
seconds:
switch (type) {
ToastrType.error => 5, // Errors should stay longer
ToastrType.warning => 4, // Warnings need attention
ToastrType.success => 3, // Success can be shorter
ToastrType.info => 3, // Info can be shorter
} +
(message.length / 50).ceil(),
);