text_balancer 0.1.7
text_balancer: ^0.1.7 copied to clipboard
Flutter package that makes text more readable.
Flutter package that makes text more readable.
It works with fixed-width as well as variable-width fonts.
How To Use #
/// Widget
TextBalancer('text');
/// Widget with RichText (TextSpan)
TextBalancer.rich(
TextSpan(
text: 'Hello ',
children: [
TextSpan(text: 'World', style: TextStyle(fontWeight: FontWeight.bold)),
],
),
);
/// Text Extension
Text('text').balance(
context,
maxWidth: constraints.maxWidth,
);
/// String Extension
'text'.balance(
textStyle: textStyle,
maxWidth: constrains.maxWidth,
)
Performance #
- Time complexity :
n^2