Parsed Readmore

A package which allows to enter text which can be collapsed and expanded. Moreover, it will automatically parse the urls present in the text into hyperlinks.

Demo Gif


  • Expandable and Collapsable text.
  • Trimming can either be done on basis of length or number of lines.
  • Option to include a customised delimiter.
  • Automatically parses the urls present in the text into hyperlinks which launches the browser on click event.
  • All the text components including the parsed urls, delimiter, clickable texts, etc can be given seperate custom styles.
  • Addition of user defined action on clicking the hyperlinks (latest addition).
  • Option to add custom text styles for target text (latest addition).


Run this command in your terminal

flutter pub add parsed_readmore

Or add it manually in your project's pubspec.yaml (and run an implicit flutter pub get):


Usage Example

For detailed implementation refer to the example

Import parsed_readmore.dart

import 'package:parsed_readmore/parsed_readmore.dart';

The code below will implement all features of the widget with the default values which are :

  • trimMode = TrimMode.length
  • delimiter = ' ...'
  • trimLength = 240
  • trimExpandedText = 'show less',
  • trimCollapsedText = 'read more',

If you need to use some customized values for different elements of the widget just add values to the relevant parameters.

    urlTextStyle: TextStyle(color:, fontSize: 20, decoration: TextDecoration.underline),
    trimMode: TrimMode.line,
    trimLines: 4,
    delimiter: '  ***',
    delimiterStyle: TextStyle(color:, fontSize: 20),
    style: TextStyle(color:, fontSize: 20),
    onTapLink: (url) {
          content: Text(
              '$url is displayed because we have used custom onTap function for hyperlinks')));
    highlightText: TargetTextHighlight(
        targetText: 'the',
        style: const TextStyle(
            fontSize: 20.0,
            fontStyle: FontStyle.italic,
            color: Colors.purple)),
    trimCollapsedText: 'expand',
    trimExpandedText: 'compress',
    moreStyle: TextStyle(color:, fontSize: 20),
    lessStyle: TextStyle(color:, fontSize: 20),


Please file any issues, bugs or feature request as an issue on the GitHub page. If you have some idea for feature upgrade, feel free to contact me through email