-
-
Notifications
You must be signed in to change notification settings - Fork 918
Closed
Description
It seems the property shrinkToFit from the old RichText parser is not supported anymore in latest version 1.0.0, but it wasn't mentioned in the migration guide.
I'm still quite new user of this library, what is the best way to avoid having the Html widget using a double.infinity
width ?
Maybe would it make sense to add back support for this property shrinkToFit in the SizeBox to avoid having double.infinity?
Something in that mind maybe:
class StyledText extends StatelessWidget {
final InlineSpan textSpan;
final Style style;
final bool shrinkToFit;
const StyledText({
this.textSpan,
this.style,
this.shrinkToFit = false
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: (style.display == Display.BLOCK || style.display == Display.LIST_ITEM) && !this.shrinkToFit
? double.infinity
: null,
child: Text.rich(
textSpan,
style: style.generateTextStyle(),
textAlign: style.textAlign,
textDirection: style.direction,
),
);
}
}
Thanks in advance for your suggestions.
eggnstone
Metadata
Metadata
Assignees
Labels
No labels