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

パッケージ詳細v1.2.1

rich_input

豊富な入力ボックス、@someone およびトピックを色付きハイライトで実装。

30日間ダウンロード
23
いいね数
18
Pub ポイント
40

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

flutter pub add rich_input

パッケージ概要

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

RichInput は、@メンションや色付きハイライトによるトピックタグなど、豊富なフォーマット機能を備えた拡張テキスト入力を可能にするFlutterパッケージです。フォーマットされたテキストに対するリアルタイムの視覚フィードバックをサポートしており、チャットインターフェース、コメントセクション、共同編集ツールに最適です。カスタマイズを重視して設計されており、開発者が動的なコンテンツレンダリング用のパターンとスタイルルールを定義できるようにしています。既存のフォームやテキストフィールドにスムーズに統合され、直感的でインタラクティブな入力機能によりユーザー体験を向上させます。

用途

  • チャットアプリケーション
  • コメントシステム
  • 共同文書編集
  • ソーシャルメディアプラットフォーム
  • タスク管理ツール

主な機能

  • @mention 検出
  • 色によるトピックタグ付け
  • リアルタイム形式
  • カスタマイズ可能なスタイル
  • パターンベースのテキストハイライト

適している対象

  • インタラクティブなテキスト入力を構築する開発者
  • メンション機能を必要とするアプリ
  • 豊富なテキスト注釈を持つ UI
  • 共同テキスト機能を必要とするチーム
  • 動的コンテンツタグ付きのプロジェクト

注意事項

  • 限定されたプラットフォームサポート(指定されたプラットフォームなし)
  • 手動パターン設定が必要です
  • 追加のスタイル調整が必要になる場合があります
  • 更新に外部のソースコードに依存しています
  • 大規模なテキスト処理には最適化されていません

元の README

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

rich_input

This is a high performance rich media input box, implemented through the native textfield extension, with less disruptive, but at the same time has a strong extensibility, implements the @ someone, # topics, expressions and other functions, support custom color highlighting

Language: English | 中文简体

Special feature

  • Use native textfield capabilities with less code, less disruption and subsequent compatibility
  • Support @someone #topic and insert emojis, etc
  • Support for custom highlighting, and custom styles
  • Support for using the backspace key to delete entire special text blocks
  • Support for special character handling
  • Support for custom data fields to enhance rich text

Demo

Getting Started

Core code

import 'package:rich_input/rich_input.dart';

RichInputController controller = RichInputController(text: "Text");

const block = RichBlock(
  text: "@somebody",
  data: "@123456",
  style: TextStyle(color: Colors.blue),
);
controller.insertBlock(block);

// Get custom data
print(controller.data);
// Get text
print(controller.text);

// RichInput(controller: controller);

Example

import 'package:flutter/material.dart';
import 'package:rich_input/rich_input.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  RichInputController _controller;
  FocusNode _focusNode;

  @override
  void initState() {
    _focusNode = FocusNode();
    _controller = RichInputController(text: "Text");

    // Refresh text display, not required
    _controller.addListener(() {
      setState(() {});
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Padding(
          padding: const EdgeInsets.all(15),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              RichInput(
                focusNode: _focusNode,
                controller: _controller,
              ),
              Wrap(
                spacing: 10,
                children: [
                  RaisedButton(
                    onPressed: () {
                      _controller.insertText("Text");
                    },
                    child: const Text("Add Text"),
                  ),
                  RaisedButton(
                    onPressed: () {
                      _controller.insertText("😁");
                    },
                    child: const Text("Add 😁"),
                  ),
                  RaisedButton(
                    onPressed: () {
                      _controller.insertText("👍");
                    },
                    child: const Text("Add 👍"),
                  ),
                  RaisedButton(
                    onPressed: () {
                      const block = RichBlock(
                        text: "@abc",
                        data: "@123456",
                        style: TextStyle(
                          color: Colors.blue,
                          fontWeight: FontWeight.bold,
                        ),
                      );
                      _controller.insertBlock(block);
                    },
                    child: const Text("Add @    "),
                  ),
                  RaisedButton(
                    onPressed: () {
                      const block = RichBlock(
                        text: "#subject",
                        data: "#888999",
                        style: TextStyle(
                          color: Colors.red,
                          fontWeight: FontWeight.bold,
                        ),
                      );
                      _controller.insertBlock(block);
                    },
                    child: const Text("Add #"),
                  ),
                  RaisedButton(
                    onPressed: () {
                      _focusNode.unfocus();
                    },
                    child: const Text("unfocus"),
                  )
                ],
              ),
              const SizedBox(height: 10),
              Text("Text:${_controller.text}"),
              const SizedBox(height: 10),
              Text("Data:${_controller.data}"),
            ],
          ),
        ),
      ),
    );
  }
}

For detailed examples

カテゴリー

ソースリポジトリ

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

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