OudsLink class
Reference design version : 2.4.0
Link is a UI element that allows to navigate from one location to another, either within the same page or across different pages in the same resource, or to an external resource. Link's primary function is navigation and it communicates its interactive nature visually and semantically.
parameters :
- size : The size of the link, OudsLinkSize such as small or default, to fit various visual needs.
- density : The density of the link, OudsLinkDensity such as compact or default.
- label : A text to display in link component.
- icon : An optional SVG asset name to display an icon within the link (used with OudsLink.icon).
- tinted : tinted Controls whether the icon should be tinted with the theme color. Defaults to
true. When set tofalse, the icon is displayed with its original colors (e.g., for multi-color icons). Note that untinted icons must ensure sufficient contrast with the background for accessibility reasons, only used with OudsLink.icon. - onPressed: Callback invoked when the link is clicked.
OudsLink provides a dedicated named constructor for every supported variant:
- The default (unnamed) constructor renders a text-only link.
- OudsLink.icon renders a label with a custom icon.
- OudsLink.previous renders a "backward" navigation link with a leading chevron.
- OudsLink.next renders a "forward" navigation link with a trailing chevron.
- OudsLink.external renders a link navigating outside the current context, with a trailing indicator.
You can use OudsLink component in your project, customizing parameters as needed :
Small Text only :
This is the default layout of the component.
OudsLink(
label: 'Label',
size: OudsLinkSize.small,
onPressed: () {}
);
Link with Icon :
Creates an OudsLink displaying its label alongside a custom icon.
OudsLink.icon(
label: 'Label',
icon: 'assets/ic_heart.svg',
tinted: true,
onPressed: () {}
);
Next :
Creates an OudsLink used for standard navigation, displaying a trailing chevron after the label.
OudsLink.next(
label: 'Label',
onPressed: () {}
);
Previous :
Creates an OudsLink used for "backward" navigation, displaying a leading chevron before the label.
OudsLink.previous(
label: 'Label',
onPressed: () {}
);
External :
Creates an OudsLink used to navigate outside the current product, service or application. The external navigation indicator informs users that the destination belongs to another context.
OudsLink.external(
label: 'Label',
onPressed: () {}
);
Compact density link :
Reduces the link's minimum height and block padding, useful in dense layouts.
OudsLink(
label: 'Label',
density: OudsLinkDensity.compact,
onPressed: () {}
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- OudsLink
Constructors
- OudsLink({Key? key, required String label, @Deprecated('OudsLinkLayout is deprecated and will be removed in a future version. ' 'Use the dedicated OudsLink.icon, OudsLink.previous, OudsLink.next or ' 'OudsLink.external constructors instead.') OudsLinkLayout layout = OudsLinkLayout.textOnly, OudsLinkSize size = OudsLinkSize.defaultSize, OudsLinkDensity density = OudsLinkDensity.defaultDensity, VoidCallback? onPressed, String? icon})
-
Creates a text-only OudsLink.
const
- OudsLink.external({Key? key, required String label, OudsLinkSize size = OudsLinkSize.defaultSize, OudsLinkDensity density = OudsLinkDensity.defaultDensity, VoidCallback? onPressed})
-
Creates an OudsLink navigating outside the current product, service or
application, displaying a trailing external indicator after the
label.const - OudsLink.icon({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
labelalongside a customicon.const - OudsLink.next({Key? key, required String label, OudsLinkSize size = OudsLinkSize.defaultSize, OudsLinkDensity density = OudsLinkDensity.defaultDensity, VoidCallback? onPressed})
-
Creates an OudsLink used for standard navigation, displaying a
trailing chevron after the
label.const - OudsLink.previous({Key? key, required String label, OudsLinkSize size = OudsLinkSize.defaultSize, OudsLinkDensity density = OudsLinkDensity.defaultDensity, VoidCallback? onPressed})
-
Creates an OudsLink used for "backward" navigation, displaying a
leading chevron before the
label.const
Properties
- density → OudsLinkDensity
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → String?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
final
- layout → OudsLinkLayout
-
final
- onPressed → VoidCallback?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → OudsLinkSize
-
final
- tinted → bool
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< OudsLink> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited