From 6923b58fdb15ceb65f38e1badb3b3a08d6cf9be6 Mon Sep 17 00:00:00 2001 From: iamstanlee Date: Thu, 3 Jun 2021 20:31:39 -0700 Subject: [PATCH] fix pub warnings --- CHANGELOG.md | 4 ++-- README.md | 33 +++++++++++++++++++++++++++++++-- lib/linkify_text.dart | 2 +- pubspec.yaml | 3 +-- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac07159..77c485d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -## [0.0.1] - TODO: Add release date. +## 1.0.0 -* TODO: Describe initial release. +- Released `v1.0.0` diff --git a/README.md b/README.md index 4d57558..5383a6c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,32 @@ -# linkify_text +A lightweight flutter package to linkify texts containing urls, emails and hashtags. -### A lightweight flutter package to linkify texts with urls, emails and hashtags +[![pub package](https://img.shields.io/pub/v/http.svg)](https://pub.dev/packages/linkfy_text) + +## Using + +```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}"); + }, + ); +``` + +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}"); + }, + ); +``` diff --git a/lib/linkify_text.dart b/lib/linkify_text.dart index e2e7128..590b9f6 100644 --- a/lib/linkify_text.dart +++ b/lib/linkify_text.dart @@ -1,5 +1,5 @@ /// A lightweight flutter package to linkify texts containing urls, emails and hashtags. -library linkify_text; +library linkfy_text; export 'src/linkify.dart'; export 'src/enum.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index ff9389f..d93eed0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,7 @@ name: linkfy_text description: A lightweight flutter package to linkify texts containing urls, emails and hashtags. version: 1.0.0 -author: -homepage: +homepage: https://github.com/Iamstanlee/linkfy_text environment: sdk: '>=2.12.0 <3.0.0'