parsed_readmore 0.0.1 parsed_readmore: ^0.0.1 copied to clipboard
A Flutter text widget which is expandable and can automatically parse urls present in the text it into clickable links.
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 a hyperlink.
Features #
- 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.
Installation #
dart pub add parsed_readmore
import 'package:parsed_readmore/parsed_readmore.dart';
Usage #
For detailed implementation refer to the example #
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',
ParsedReadMore(inputString)
If you need to use some customized values for different elements of the widget just add values to the relevant parameters.
ParsedReadMore(
inputString,
urlTextStyle: TextStyle(color: Colors.green, fontSize: 20, decoration: TextDecoration.underline),
trimMode: TrimMode.line,
trimLines: 4,
delimiter: ' ***',
delimiterStyle: TextStyle(color: Colors.black, fontSize: 20),
style: TextStyle(color: Colors.orange, fontSize: 20),
trimCollapsedText: 'expand',
trimExpandedText: 'compress',
moreStyle: TextStyle(color: Colors.red, fontSize: 20),
lessStyle: TextStyle(color: Colors.blue, fontSize: 20),
)
Issues #
Please file any issues, bugs or feature request as an issue on the GitHub page. Moreover, feel free to contact me through email aashish.260401@gmail.com.