render method
Renders the component as a string.
Implementation
@override
String render() {
final style = renderConfig.configureStyle(Style());
final (prefix, renderPrefix) = switch (type) {
AlertType.info => (
'[INFO]',
(String s) => style.foreground(Colors.info).bold().render(s),
),
AlertType.success => (
'[OK]',
(String s) => style.foreground(Colors.success).bold().render(s),
),
AlertType.warning => (
'[WARN]',
(String s) => style.foreground(Colors.warning).bold().render(s),
),
AlertType.error => (
'[ERROR]',
(String s) => style.foreground(Colors.error).bold().render(s),
),
AlertType.note => ('[NOTE]', (String s) => style.dim().render(s)),
};
return '${renderPrefix(prefix)} $message';
}