Link
Overview
Links are used as navigational elements. They may appear on their own, within a sentence or paragraph, or directly following the content.

Widget API
Property
Description
url
The destination that this link leads to.
Type:
String
Default: required
onTap
Called when the link is tapped, it also passes the url value.
Type:
Function(String url)
Default: required
enable
Whether the widget is enabled or not.
Type:
bool
Default:
true
caption
A caption text to display instead of the url. If it's null, then the URL will be displayed.
Type:
String?
Default: optional
fontSize
The size of glyphs (in logical pixels) to use when painting the text.
Type:
double
Default:
14
Example
CLink(
url: 'www.google.com',
onTap: (url) {},
);
// OR
CLink(
url: 'www.google.com',
caption: 'Google',
onTap: (url) {},
);
// OR
CLink(
enable: false,
caption: 'Google',
url: 'www.google.com',
onTap: (url) {},
);
Last updated
Was this helpful?