soft_hyphen_text 0.1.0 copy "soft_hyphen_text: ^0.1.0" to clipboard
soft_hyphen_text: ^0.1.0 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
Screenshot of SoftHyphenText in action

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: 'Hello­world')

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 Text widget properties like style, textAlign, etc. are supported.
3
likes
140
points
187
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for wrapping text with soft hyphens.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on soft_hyphen_text