A super fast lightweight easy to use package to implement read more functionality in your app. It's responsive to different screen sizes, and supports all platforms.
The Read more text is an easy to use yet powerful, and high customizable widget that brings the read more functionality to your app:
TextStyle
.ReadMoreText.selectable
selectable to
instruct the package to use SelectableText
widget instead of Text
widget with all the customization like cursorColor
, cursorWidth
, and cursorHeight
, etc...add to your pubspec.yaml:
read_more_text: ^0.0.5
then import it to your file:
import 'package:read_more_text/read_more_text.dart';
then use it:
ReadMoreText(
'This is a very long text to demo the usages of this package\n'
'This is a very long text to demo the usages of this package\n'
'This is a very long text to demo the usages of this package\n'
'This is a very long text to demo the usages of this package',
numLines: 2,
readMoreText: 'Read more',
readLessText: 'Read less',
)
The result will be: