0

In my application I need to show options for Show more and Show less for the attributed text. If there is the simple Text then I could manage the things by using .subString function for first few characters and full text.

But here in my case I am using flutter_html lib. Here if I take data using .subString then attributed text getting disturbed which creates wrong output.

For consideration my text is as mentioned below:

The system requirements are\r\n :

    \r\n
  • An internet connection – broadband wired or wireless (3G or 4G/LTE)
  • \r\n
  • Speakers and a microphone (required in case of interactive sessions) – Built-in, USB plug-in, or wireless Bluetooth
  • \r\n
  • A webcam or HD webcam - built-in, USB plug-in (required in case of interactive sessions)
  • \r\n
  • CLICK HERE to view the System Requirements for Zoom.
  • \r\n

Consider the image as mentioned below:

enter image description here

Is there something else can be done here to achieve this feature without using .subString feature!!??

Kishan sharma
  • 701
  • 1
  • 6
  • 20

1 Answers1

0

Solution 1 : You can try https://pub.dev/packages/readmore , this plugin. A Flutter plugin that allow expand and collapse text.

Solution 2 : Flutter: How to hide or show more text within certain length

Coder Addy
  • 423
  • 3
  • 18
  • I went through your response but https://pub.dev/packages/readmore doesn't support the attributed texts and for solution 2 they are using .subStrings to show and hide their content. Is there some thing else we can manage here!!?? – Kishan sharma Feb 07 '22 at 10:55