From e71d8c33834e5d3e040413e34d4ca155a526e489 Mon Sep 17 00:00:00 2001 From: iamstanlee Date: Thu, 3 Jun 2021 21:35:39 -0700 Subject: [PATCH] updated readme --- README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 946f873..76d293d 100644 --- a/README.md +++ b/README.md @@ -7,26 +7,25 @@ A lightweight flutter package to linkify texts containing urls, emails and hasht ```dart // first import the package import 'package:linkfy_text/linkify_text.dart'; - - - LinkifyText( - "This text contains a url: https://flutter.dev", - linkStyle: TextStyle(color: Colors.blue, fontSize: 16), - onTap: (link) { - print("${link.value}"); - }, - ); +LinkifyText( + "This text contains a url: https://flutter.dev", + linkStyle: TextStyle(color: Colors.blue, fontSize: 16), + onTap: (link) { + // onTap is called when a link is pressed + 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 ```dart - LinkifyText( - "This text contains an #hashtag", - linkStyle: TextStyle(color: Colors.blue, fontSize: 16), - linkTypes: [LinkType.hashtag] - onTap: (link) { - print("${link.value}"); - }, - ); +LinkifyText( + "This text contains an #hashtag", + linkStyle: TextStyle(color: Colors.blue, fontSize: 16), + linkTypes: [LinkType.hashtag] + onTap: (link) { + print("${link.value}"); + }, + ); ```