A Flutter Text widget support word break for CJK

Overview

word_break_text

Text widget with word break support for CJK sentence.

Screenshot

Installation

Add flutter_map to your pubspec:

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

Usage

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Column(
        mainAxisSize: MainAxisSize.max,
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          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. I appreciate to @06153. It is insanely genious solution. but I hope so flutter team support natively word break in CJK sentence. Please.

You might also like...

Flutter Custom, Text, 3D, Social media button's package

Flutter Custom, Text, 3D, Social media button's package

Flutter Button flutter_button, which is a flutter package, contains animated, cool and awesome buttons. That you may like, thanks to this package you

Dec 29, 2022

A button that looks like a Cupertino text button

A button that looks like a Cupertino text button

Cupertino Text Button A button that looks like a Cupertino text button! Text Button A simple text button can be created like this: CupertinoTextButton

Nov 24, 2022

Experimental solution for web-like text selection across widgets

Experimental solution for web-like text selection across widgets

Better Selection Experimental solution for web-like text selection across widgets (text, images, et cetera). Better selection is dependent on, and is

Oct 12, 2022

Listview builder with image and text

listview_builder_with_image_and_text A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resource

May 4, 2022

Flutter progress dialog. Support both Android and iOS platform.

Flutter progress dialog. Support both Android and iOS platform.

Flutter Progress Dialog [pub packages] | Flutter progress dialog. Support both Android and iOS platform

Oct 9, 2022

An assets picker in WeChat style, support multi assets picking.

An assets picker in WeChat style, support multi assets picking.

An assets picker in WeChat style, support multi assets picking.

Jan 8, 2023

Provider support for overlay, make it easy to build toast and In-App notification.

overlay_support Provider support for overlay, make it easy to build toast and In-App notification. this library support ALL platform Interaction If yo

Jan 1, 2023

Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Similar to Weibo dynamics, WeChat circle of friends, nine grid view controls to display pictures. Support single big picture preview.

Dec 28, 2022

A simple Flutter widget to add in the widget tree when you want to show nothing, with minimal impact on performance.

nil A simple widget to add in the widget tree when you want to show nothing, with minimal impact on performance. Why? Sometimes, according to a condit

Dec 22, 2022
Comments
  • 긴 어절이 있을 때 발생하는 줄넘김 문제 해결 및 테스트를 위한 코드 추가

    긴 어절이 있을 때 발생하는 줄넘김 문제 해결 및 테스트를 위한 코드 추가

    안녕하세요

    아래의 이미지처럼 긴 문장이 주어진 경우 줄넘김이 부자연스러운 부분 수정했습니다. 알고리즘은 다음과 같습니다. 쪼개진 어절들의 텍스트 너비를 구합니다. 그 후 해당 텍스트의 너비가 주어진 공간의 최대 너비보다 큰 경우 계속해서 해당 어절을 쪼갭니다. |수정 전|수정 후| |------|-----| |스크린샷 2022-01-25 오후 12 07 15|스크린샷 2022-01-25 오후 12 06 29|

    또한 테스팅을 할 수 있도록 WordBreakTextFinder을 추가했습니다.

    enhancement 
    opened by jja08111 1
Releases(0.1.0)
Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more.

flutter_donation_buttons Donation/Support buttons to allow you to add your favorite support buttons like: Paypal, Ko-fi or Patreon and more. Getting S

null 6 Dec 10, 2022
A flutter carousel widget, support infinite scroll, and custom child widget.

carousel_slider A carousel slider widget. Features Infinite scroll Custom child widgets Auto play Supported platforms Flutter Android Flutter iOS Flut

Bart T 1 Nov 25, 2021
Flutter widget to show text in popup or overlay container

flutter_show_more_text_popup Flutter widget to show text in popup or overlay container Installation Add this to your package's pubspec.yaml file depen

Sanjay Sharma 44 Jul 5, 2022
A Flutter widget to show a text form field to display a date or clock dialog

A Flutter widget to show a text form field to display a date or clock dialog. This widget extend TextField and has a similar behavior as TextFormField.

m3uzz Soluções em TI 82 Jan 6, 2023
A Flutter widget that scrolls text infinitely

⏩ A Flutter widget that scrolls text infinitely. Provides many customizations including custom scroll directions, durations, curves as well as pauses after every round.

Marcel Garus 219 Dec 29, 2022
An advanced switch widget, that can be fully customized with size, text, color, radius of corners.

flutter_advanced_switch An advanced switch widget, that can be fully customized with size, text, color, radius of corners. Switch Light Switch Dark Ge

Alex Melnyk 13 Dec 15, 2022
A Flutter Country Picker Widget with support to country dialing codes

flutter_country_picker A Flutter Country Picker Widget with support to country dialing codes Usage Add the CountryPicker widget in your layout and use

Alessandro Biessek 49 Apr 6, 2022
Plugin to the JSON Dynamic Widget to provide named support for Ionicons

json_dynamic_widget_plugin_ionicons Table of Contents Live Example Introduction Using the Plugin Live Example Web Introduction Plugin to the JSON Dyna

null 0 May 14, 2022
PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

PowerFileView - A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.

Yao 8 Oct 22, 2022
Flutter package: Define a theme (colors, text styles etc.) as static const values which can be changed dynamically.

Flutter package: Define a theme (colors, text styles etc.) as static const values which can be changed dynamically. Also comes with useful extensions to create text styles by composition.

Marcelo Glasberg 21 Jan 2, 2023