ariaAttr function
Helper for constructing a single ARIA attribute map entry.
Automatically prefixes name with aria- if not already present.
Div(
attrs: {
...ariaAttr('modal', 'true'),
},
)
Implementation
Map<String, String> ariaAttr(String name, String value) {
final key = name.startsWith('aria-') ? name : 'aria-$name';
return {key: value};
}