OudsLink.icon constructor
- Key? key,
- required String label,
- required OudsIcon? icon,
- OudsLinkSize size = OudsLinkSize.defaultSize,
- OudsLinkDensity density = OudsLinkDensity.defaultDensity,
- VoidCallback? onPressed,
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: Icon displayed in the link that can be used to indicate the destination or type of content being referenced. displayed alongside thelabel. Its size automatically adapts tosize. Its OudsIcon.tinted property controls whether the icon is tinted with the theme color (defaults totrue); set it 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.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.
Implementation
const OudsLink.icon({
super.key,
required this.label,
required this.icon,
this.size = OudsLinkSize.defaultSize,
this.density = OudsLinkDensity.defaultDensity,
this.onPressed,
}) : _indicator = null,
layout = OudsLinkLayout.textAndIcon;