updated readme

This commit is contained in:
iamstanlee 2021-06-03 21:35:39 -07:00
parent d62fe10784
commit e71d8c3383
1 changed files with 16 additions and 17 deletions

View File

@ -7,21 +7,20 @@ A lightweight flutter package to linkify texts containing urls, emails and hasht
```dart ```dart
// first import the package // first import the package
import 'package:linkfy_text/linkify_text.dart'; import 'package:linkfy_text/linkify_text.dart';
LinkifyText(
LinkifyText(
"This text contains a url: https://flutter.dev", "This text contains a url: https://flutter.dev",
linkStyle: TextStyle(color: Colors.blue, fontSize: 16), linkStyle: TextStyle(color: Colors.blue, fontSize: 16),
onTap: (link) { onTap: (link) {
// onTap is called when a link is pressed
print("${link.value}"); print("${link.value}");
}, },
); );
``` ```
Be default, The above snippet would linkify all urls in the string, you can choose whatxw type of link to linkify by passing the `linkTypes` parameter Be default, The above snippet would linkify all urls in the string, you can choose whatxw type of link to linkify by passing the `linkTypes` parameter
```dart ```dart
LinkifyText( LinkifyText(
"This text contains an #hashtag", "This text contains an #hashtag",
linkStyle: TextStyle(color: Colors.blue, fontSize: 16), linkStyle: TextStyle(color: Colors.blue, fontSize: 16),
linkTypes: [LinkType.hashtag] linkTypes: [LinkType.hashtag]