flutter_highlight_search_text 0.0.1 copy "flutter_highlight_search_text: ^0.0.1" to clipboard
flutter_highlight_search_text: ^0.0.1 copied to clipboard

This is a Simple Inherited Widget to highlight text in a search result, with custom highlight TextStyle.This package is perfect for building search functionalities where you want to draw attention to [...]

flutter_highlight_search_text #

flutter_highlight_search_text is a Flutter package designed to highlight search text within a string. It provides a customizable and efficient way to emphasize specific portions of text, making it ideal for search functionalities and text displays.

Features #

  • Customizable Text and Highlight Styles:

    • Easily apply custom text styles for both the regular and highlighted portions of your text. Set your preferred colors, fonts, sizes, and more.
  • Supports Case-Insensitive Matching:

    • The widget can highlight text regardless of the case, ensuring that all instances of the search query are highlighted correctly.
  • Efficient Text Splitting:

    • Optimized for splitting and finding the query within the text, ensuring smooth performance even with large strings.
  • Flexible Max Lines:

    • Control the number of lines displayed with the maxLines parameter, allowing text to be truncated with ellipsis when necessary.
  • Handles Edge Cases:

    • The widget gracefully handles cases where the search query is empty or not found within the text, ensuring consistent behavior.
  • Easy Integration:

    • Simply drop the SearchHighlightText widget into your app and customize it according to your needs with a few lines of code.

Getting started #

To use this package, follow these steps:

  1. Add the Dependency:

    Add flutter_highlight_search_text to your pubspec.yaml file:

Usage #

  SearchHighlightText(
text: 'This is text',
query: "text",
),

1
likes
140
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

This is a Simple Inherited Widget to highlight text in a search result, with custom highlight TextStyle.This package is perfect for building search functionalities where you want to draw attention to matched text within a list of results or any other use case where text highlighting is needed.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_highlight_search_text