パッケージ、リポジトリ、アプリカテゴリを検索

utils_rinch_text のカバー
パッケージ詳細v1.0.3

utils_rinch_text

このメソッドは、長いテキストのフォーマットに適した TextSpan のリストを返します。この実装では以下のタグがサポートされています。例を参照してください。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
19
いいね数
9
Pub ポイント
160

パッケージをインストール

flutter pub add utils_rinch_text

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

utils_rinch_text パッケージは、TextSpan を使用して長いテキストをフォーマットするためのユーティリティメソッドを提供し、カスタムタグによるリッチテキストレンダリングをサポートしています。埋め込み形式で構造化されたテキスト表示を可能にし、チャットメッセージやフォーマット済み説明のような動的コンテンツに最適です。このパッケージはすべての主要プラットフォームと互換性があり、手動での Span 管理なしに複雑なテキストレイアウトを作成することを容易にします。クリーンな API を活用して、タグ付きテキストを効率的に解析およびレンダリングします。

用途

  • チャットメッセージの書式設定
  • 動的コンテンツのレンダリング
  • UI コンポーネント内のリッチテキスト
  • フォーマットされた説明
  • ユーザー生成テキスト処理

主な機能

  • カスタムテキストタグをサポート
  • TextSpan リストを生成します
  • クロスプラットフォーム互換性
  • シンプルな API インテグレーション
  • 効率的なテキストパース

適している対象

  • 豊富なテキストが必要なアプリ
  • チャットまたはメッセージインターフェース
  • コンテンツが豊富なUI
  • テキスト書式設定ユーティリティ
  • シンプルさを求めるFlutter開発者

注意事項

  • 適切なタグ構文が必要です
  • テキスト形式のみに制限
  • 組み込みのスタイルオプションなし
  • 正しい入力構造に依存する
  • 複雑なレイアウトには適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

This method returns a list of TextSpan ideal for formatting long text this implementation supports the following tags, see example.

<a>Link web<a>
<p> add paragraph

Captura de tela 2023-02-03 195339

Add custom tags

Text de example:

 String textExample = """
  <i>Flutter<i> is an open source mobile app development framework <l>created by Google.<l> 
  It enables the creation of native apps for <i>iOS and Android<i> with a single Dart code base. 
  With its flexible and performant architecture, <o>Flutter has become one of the most 
  popular options for building mobile apps.<o> In addition, it offers a wide range of widgets 
  and animated visual effects that help you create attractive and intuitive applications. <p>
  For more information about Flutter, head over to the main 
  page at <a>https://flutter.dev/<a> and start <b>exploring the possibilities<b> 
  of this powerful app development tool.
  """;

Implementation

RichText(
   text: TextSpan(
     children: UtilsRinchText.generate(
       textExample,
       customTags: {
         "<i>": const TextStyle(
           fontWeight: FontWeight.bold,
           fontSize: 20,
         ),
         "<l>": const TextStyle(
           fontSize: 20,
           color: Colors.red,
           fontWeight: FontWeight.bold,
         ),
         "<a>": const TextStyle(
           color: Colors.green,
           fontWeight: FontWeight.bold,
         ),
         "<o>": const TextStyle(
           fontWeight: FontWeight.bold,
           color: Colors.blue,
           fontSize: 20,
         ),
         "<b>": const TextStyle(
           fontWeight: FontWeight.bold,
           color: Colors.orange,
           fontSize: 20,
         ),
       },
     ),
   ),
 ), 

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。