I have managed to limit html content by using maxlines property of Style and display "show more" text in case the content overflows the maxlines value.
Html( data: notifications[index] .longDescription, shrinkWrap: true, style: { 'body': Style( maxLines: notifications[ index] .isExpaned ? 10000 : 2, textOverflow: TextOverflow .ellipsis) }),
Now the problem is to detect if the widget has overflowed or not because i have to hide "view more" option in case the content is less than 2 lines.
Can anyone suggest any alternate way of getting List of TextSpan in flutter_html^2.1.0 so that I can use that list like this