tag_highlight_text 1.0.0 copy "tag_highlight_text: ^1.0.0" to clipboard
tag_highlight_text: ^1.0.0 copied to clipboard

outdated

This library will support highlight text by tags with specific styles and tap actions.

Tag Highlight Text Library #

This library will support highlight text by tags with specific styles and tap actions.

Usage #

To use this package, add tag_highlight_text as a dependency in your pubspec.yaml file.

Example #

Import the library

import 'package:tag_highlight_text/tag_highlight_text.dart';

You need use tags to mark highlight texts

final text = 'This is <highlight>Highlight <bold>Text</bold></highlight>';

After, call the TagHighlightText widget and define highlightMaps to set style and tap actions for each tags.

TagHighlightText(
  text: text,
  highlightMaps: {
    'highlight': HighlightData(
      style: TextStyle(
        color: Colors.red,
      ),
    ),
    'bold': HighlightData(
      style: TextStyle(
        fontWeight: FontWeight.bold,
      ),
      onTap: () {
        print('Click');
      },
    )
  },
  textStyle: TextStyle(
    color: Colors.black,
    fontSize: 18,
  ),
),
12
likes
0
points
1.41k
downloads

Publisher

unverified uploader

Weekly Downloads

This library will support highlight text by tags with specific styles and tap actions.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on tag_highlight_text