soft_hyphen_text 0.0.2
soft_hyphen_text: ^0.0.2 copied to clipboard
A Flutter package for wrapping text with soft hyphens.
SoftHyphenText #
This widget can be used like the text widget but takes care of soft hyphens inside strings and wraps the text accordingly.
Features #
- Handles soft hyphens (U+00AD) in text
- Automatically adds visible hyphens when text wraps at a soft hyphen position
- Preserves original text when no wrapping occurs
Getting started #
Add the package to your pubspec.yaml:
dependencies:
soft_hyphen_text: ^0.0.1
Usage #
Simply use the SoftHyphenText widget instead of the standard Text widget:
SoftHyphenText(text: 'Helloworld')
The soft hyphen character (U+00AD) is invisible but indicates potential hyphenation points. When the text wraps at these points, a visible hyphen will be displayed.
Example with different container widths #
Column(
children: [
Container(
width: 80,
child: SoftHyphenText(text: 'TextWithSoftHyphenCharacter'),
),
],
)
Additional information #
- All standard
Textwidget properties likestyle,textAlign, etc. are supported.