linkable
a flutter widget to add links to your text. by default, the text or richtext widgets render the urls in them as simple text which are not clickable. so, linkable widget is a wrapper over richtext which allows you to render links that can be clicked to redirect to the url. that means that a linkable widget supports all the attributes of a richtext widget.
currently linkable supports the following types:
- web url (/anupkumarpanwar)
- emails (mailto:[email protected])
- phone numbers (tel:+918968894728)
note: you don’t need to specify the url scheme (mailto, tel etc). the widget will parse it automatically.
install
to install the package, add the following dependency to your pubspec.yaml
dependencies:
linkable: ^1.0.4
url_launcher: ^5.4.10
usage
basic
import 'package:linkable/linkable.dart';
linkable(
text:
"hi!ni'm anup.nnyou can email me at [email protected]nor just whatsapp me @ +91-8968894728.nnfor more info visit: ngithub.com/anupkumarpanwar nornhttps://www.linkedin.com/in/anupkumarpanwar/",
);
attributes
key | description |
---|---|
text |
the text to be displayed in the widget. |
textcolor |
color of the non-link text. (default: black) |
linkcolor |
color of the links. (default: blue) |
style |
textstyle to be applied on the widget. |
textalign |
textalign value. (default: textalign.start) |
textdirection |
determines the order to lay children out horizontally. |
maxlines |
maximum number of lines to be displayed. |
overflow |
handles text that crosses maxlines. (default: textoverflow.clip) |
textscalefactor |
the number of font pixels for each logical pixel. |
locale |
sets text locale. |
Comments are closed.