auto_wrap_ellipsis_text 1.0.0
auto_wrap_ellipsis_text: ^1.0.0 copied to clipboard
A smart text widget for pixel-perfect wrapping and truncation in Flutter.
AutoWrapEllipsisText #
AutoWrapEllipsisText is a Flutter widget that automatically wraps and truncates text based on pixel constraints.
It allows you to render dynamic text in tightly constrained spaces with precise control over wrapping and overflow.
Ideal for dashboards, cards, or any layout where text must fit within strict size limits.
Features #
- ✅ Auto-wraps text based on pixel width (not just word boundaries)
- ✂️ Truncates with ellipsis when text exceeds height or width
- 🧠 Automatically calculates
maxLinesif not specified - ⚡️ Performance-optimized with internal character-width caching
- 🎯 Compatible with all standard
Textwidget properties:style,maxLines,overflow,textAlign,softWrap,textDirection, etc.
Usage #
Here’s a quick example:
import 'package:auto_wrap_ellipsis_text/auto_wrap_ellipsis_text.dart';
AutoWrapEllipsisText(
'This is a long piece of text that wraps and truncates as needed',
style: TextStyle(fontSize: 14),
maxLines: 2,
textAlign: TextAlign.center,
);
For more, check the /example folder.