Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/changjoo-park/word_break_text

A Flutter Text widget support word break for CJK
https://github.com/changjoo-park/word_break_text

flutter-package flutter-widget

Last synced: about 1 month ago
JSON representation

A Flutter Text widget support word break for CJK

Awesome Lists containing this project

README

        

### word_break_text

Text widget with word break support for CJK sentence.

![Screenshot](https://i.imgur.com/1bdtL0j.png)

## Installation

Add flutter_map to your pubspec:

```yaml
dependencies:
word_break_text: any # or the latest version on pub.dev
```

## Usage

```dart
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
WordBreakText(
"헬로월드. 이것은 긴 문장입니다. 작은 화면에서 단어를 기준으로 줄바꿈이 되어야 합니다.",
spacingByWrap: true,
spacing: 4,
),
WordBreakText("ハローワールド。 これは長い文章です。 小さな画面で単語に基づいて改行する必要があります。"),
WordBreakText(
"你好,世界。 这是一个很长的句子。 在小屏幕上, 它应该按字换行。",
wrapAlignment: WrapAlignment.start,
),
],
),
);
}
```

## Additional information

This widget is verbose and useless when you are using english sentence.
Flutter do not support word break with CJK at this moment. If flutter supports, this widget must be change to only Text widget.

## Thanks specially

I found the comment from flutter repository [here](https://github.com/flutter/flutter/issues/59284#issuecomment-877904306). I appreciate to [@06153](https://github.com/06153). It is insanely genious solution.
but I hope so flutter team support natively word break in CJK sentence. Please.