Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anupkumarpanwar/linkable
A Flutter widget to dynamically add links to your text.
https://github.com/anupkumarpanwar/linkable
flutter link text
Last synced: 2 months ago
JSON representation
A Flutter widget to dynamically add links to your text.
- Host: GitHub
- URL: https://github.com/anupkumarpanwar/linkable
- Owner: AnupKumarPanwar
- License: mit
- Created: 2020-06-02T12:23:39.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-10-17T09:55:29.000Z (about 1 year ago)
- Last Synced: 2023-10-17T13:15:39.415Z (about 1 year ago)
- Topics: flutter, link, text
- Language: Dart
- Homepage: https://pub.dev/packages/linkable
- Size: 263 KB
- Stars: 18
- Watchers: 1
- Forks: 21
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# linkable [![pub package](https://img.shields.io/pub/v/linkable.svg)](https://pub.dartlang.org/packages/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 (https://www.github.com/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: ^3.0.2
url_launcher: ^6.1.14
```### Android
Starting from API30 (Android 11), your Android app has to list all apps it interacts with.
The following is required in `AndroidManifest.xml` or links will fail to launch.
```
....
```
### iOS
Add the `LSApplicationQueriesSchemes` entries in your `Info.plist` file.
```
LSApplicationQueriesSchemestel
```
## Usage
### Basic
```
import 'package:linkable/linkable.dart';Linkable(
text:
"Hi!\nI'm Anup.\n\nYou can email me at [email protected].\nOr just whatsapp me @ +91-8968894728.\n\nFor more info visit: \ngithub.com/anupkumarpanwar \nor\nhttps://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. |
| `textScaleFactor` | The number of font pixels for each logical pixel. |## Screenshot
![Screenshot](./example/screenshot.png)