OudsLink.icon constructor
- Key? key,
- required String label,
- required String? icon,
- OudsLinkSize size = OudsLinkSize.defaultSize,
- OudsLinkDensity density = OudsLinkDensity.defaultDensity,
- VoidCallback? onPressed,
- bool tinted = true,
Creates an OudsLink displaying its label alongside a custom icon.
key: Controls how one widget replaces another widget in the tree.label: The text displayed by the link. Required, non-empty; wraps onto multiple lines automatically if it doesn't fit the available width.icon: Required SVG asset path (or package asset) of the custom icon displayed alongside thelabel. Its size automatically adapts tosize.size: The size of the link, OudsLinkSize.defaultSize or OudsLinkSize.small, controlling text style, icon size and touch target dimensions. Defaults to OudsLinkSize.defaultSize.density: The density of the link, OudsLinkDensity.defaultDensity or OudsLinkDensity.compact, controlling the minimum height and block padding. Defaults to OudsLinkDensity.defaultDensity.onPressed: Callback invoked when the link is tapped or activated (keyboard/screen reader). Whennull, the link is rendered and announced as disabled and cannot receive focus.tinted: Whether the icon should be tinted with the theme color. Defaults totrue. Set tofalseto keep the icon's original colors (e.g. for multi-color or brand icons); in that case, ensure sufficient contrast with the background for accessibility reasons.
Implementation
const OudsLink.icon({
super.key,
required this.label,
required this.icon,
this.size = OudsLinkSize.defaultSize,
this.density = OudsLinkDensity.defaultDensity,
this.onPressed,
this.tinted = true,
}) : _indicator = null,
layout = OudsLinkLayout.textAndIcon;