getDefaultConfig static method
获取默认配置
Implementation
static ComToastConfig getDefaultConfig(ComToastType type) {
switch (type) {
case ComToastType.success:
return const ComToastConfig(
type: ComToastType.success,
icon: Icons.check_circle,
iconColor: Color(0xFF10B981),
);
case ComToastType.error:
return const ComToastConfig(
type: ComToastType.error,
icon: Icons.error,
iconColor: Color(0xFFEF4444),
);
case ComToastType.warning:
return const ComToastConfig(
type: ComToastType.warning,
icon: Icons.warning,
iconColor: Color(0xFFF59E0B),
);
case ComToastType.info:
return const ComToastConfig(
type: ComToastType.info,
icon: Icons.info,
iconColor: Color(0xFF3B82F6),
);
case ComToastType.loading:
return const ComToastConfig(
type: ComToastType.loading,
duration: -1,
clickThrough: false,
);
default:
return const ComToastConfig();
}
}