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

パッケージ詳細v1.3.0

rich_text_view

メンション、ハッシュタグ、メール、URL、さらに表示をサポートするシンプルで強力なリッチテキストビューです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
4400
いいね数
65
Pub ポイント
140

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

flutter pub add rich_text_view

パッケージ概要

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

rich_text_view は、メンション、ハッシュタグ、メールアドレス、URL、および「もっと見る」機能などのインタラクティブな要素を含むリッチテキストを表示するための柔軟で直感的な方法を提供するFlutterパッケージです。単一のテキストブロック内でクリック可能なスタイリッシュなコンポーネントを有効にすることで、テキストレンダリングを強化しています。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど複数のプラットフォームをサポートしており、動的テキストコンテンツを必要とするクロスプラットフォームアプリケーションに最適です。pubコマンドによる最小限のセットアップで、開発者は簡単にリッチテキスト機能をアプリに統合できます。

用途

  • ソーシャルメディア投稿のレンダリング
  • チャットメッセージ表示
  • ブログまたは記事のプレビュー
  • リンクを含むユーザー生成コンテンツ
  • インタラクティブなコメントセクション

主な機能

  • メンションとハッシュタグをサポート
  • URL およびメールを処理します
  • 「もっと見る」トグルを含む
  • カスタマイズ可能なスタイル
  • クロスプラットフォーム互換性
  • Flutter との簡単な統合

適している対象

  • ユーザー生成コンテンツを含むアプリ
  • メッセージングまたはソーシャルネットワーキングアプリ
  • コンテンツ豊富なUI
  • 動的テキスト表示
  • 軽量なリッチテキストソリューションを探している開発者

注意事項

  • 事前に定義されたリンクタイプに限定
  • 組み込みの画像サポートなし
  • タップイベントの手動処理が必要です
  • 複雑なリッチテキスト編集には適していない
  • 非常に長いテキストではパフォーマンスが異なる場合があります

元の README

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

rich_text_view

A simple yet powerful rich text view that supports mention, hashtag, email, url and view more.

Example

RichTextView
 RichTextView(
           text:
                      '''Who else thinks it's thinks it's just cool😎 to mention 
                      @jane when #JaneMustLive is trending without even trying 
                      to send a *bold* email to janedoe@gmail.com and verify the
                       facts talkmore of visiting www.janedoe.com''',
                  maxLines: 3,
                  truncate: true,
                  viewLessText: 'less',
                  linkStyle: TextStyle(color: Colors.blue),
                  supportedTypes: [
                    EmailParser(
                        onTap: (email) => print('${email.value} clicked')),
                    PhoneParser(
                        onTap: (phone) => print('click phone ${phone.value}')),
                    MentionParser(
                        onTap: (mention) => print('${mention.value} clicked')),
                    UrlParser(onTap: (url) => print('visting ${url.value}?')),
                    BoldParser(),
                    HashTagParser(
                        onTap: (hashtag) =>
                            print('is ${hashtag.value} trending?'))
                  ]
                )
RichTextEditor

RichTextEditor is an input field that supports suggestions when mentioning or using hashtags


        RichTextEditor(
                      decoration: InputDecoration(
                        border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(16)),
                      ),
                      suggestionController: SuggestionController(
                      mentionSymbol: '/',
                      position: SuggestionPosition.bottom,
                      mentionSuggestions: [
                        Mention(
                            imageURL: 'imageURL',
                            subtitle: 'nelly',
                            title: 'Nelly Gane'),
                        Mention(
                            imageURL: 'imageURL',
                            subtitle: 'gaus',
                            title: 'Gaus Shell')
                      ],
                      onSearchMention: (term) async {
                        return List.generate(
                            20,
                            (index) => Mention(
                                id: index.toString(),
                                imageURL: 'imageURL',
                                subtitle: term.toLowerCase(),
                                title: '$term $index'));
                      },
                      onMentionSelected: (suggestion) {
                        print(suggestion.id);
                      },
                      onSearchTags: (term) async {
                        return [
                          HashTag(
                              hashtag: '#Dart',
                              subtitle: '30 posts',
                              trending: true),
                          HashTag(
                            hashtag: '#Flutter',
                            subtitle: '56 posts',
                          )
                        ];
                      },
                    ))
Todo
  • Add styles to mentions/hashtags in RichTextEditor

カテゴリー

ソースリポジトリ

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

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