v0.2.1link_text
适用于 Flutter 应用的易于使用的文本小部件,可将内联 URL 转换为可点击链接。支持自定义样式。
49喜欢 3040近 30 天下载140Pub 分数
AndroidiOSWebmacOSWindowsLinux
适用于 Flutter 应用的易于使用的文本小部件,可将内联 URL 转换为可工作的可点击链接
{"sdk":"flutter"}^6.2.4{"sdk":"flutter"}以下为英文项目原文快照,最新内容请访问 GitHub。
Easy to use text widget for Flutter apps, which converts inlined URLs into clickable links. Allows custom styling.
Image
LinkText widget does not require any setup. Simply pass a String with inlined URLs, and the widget will take care of the rest.
final String _text = 'Lorem ipsum https://flutter.dev\nhttps://pub.dev';
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: LinkText(
_text,
textAlign: TextAlign.center,
// You can optionally handle link tap event by yourself
// onLinkTap: (url) => ...
),
),
);
}
Add to pubspec.yaml:
dependencies:
link_text: ^0.2.1
For more info, check out example project.