Search packages, repositories and app categories

flutter_richtext_composer cover
Package detailsv0.2.3

flutter_richtext_composer

A Flutter package for composing rich text in a i18n friendly way

AndroidiOSWebmacOSWindowsLinux
30-day downloads
149
Likes
7
Pub points
150

Install package

flutter pub add flutter_richtext_composer

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package designed to simplify the creation of rich text with support for internationalization (i18n). It enables developers to compose formatted text with multiple styles, links, and emojis in a clean, readable way while ensuring proper localization. The package integrates seamlessly into Flutter apps across all major platforms, making it ideal for dynamic content such as notifications, messages, or instructional UIs. Its API is intuitive and focused on maintainability and scalability.

Use cases

  • Building localized chat interfaces
  • Displaying styled user-generated content
  • Creating multilingual instructional text
  • Generating dynamic notification messages
  • Implementing rich-formatted tooltips

Key features

  • i18n-friendly rich text composition
  • Support for multiple text styles and links
  • Easy integration with Flutter's Text widgets
  • Cross-platform compatibility
  • Clean, declarative API
  • Emoji and special character handling

Suitable for

  • Developers building multilingual apps
  • Teams needing maintainable rich text logic
  • Apps with dynamic or user-generated content
  • UIs requiring formatted text with localization
  • Projects emphasizing readability and scalability

Considerations

  • Requires careful handling of translation keys
  • May increase bundle size slightly with extensive formatting
  • Limited to text-based content, not images or complex layouts
  • Depends on correct i18n setup in the parent app
  • Not intended for high-performance text rendering at scale

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

flutter_richtext_composer

Latest version on pub.dev

A Flutter package for composing RichText in a i18n friendly way.

Getting Started

Import the library with

import 'package:flutter_richtext_composer/flutter_richtext_composer.dart';

Example

Then you can start composing RichText like this:

RichTextComposer(
  'Hi {name}, I am {my_name}! {icon}',
  style: TextStyle(fontSize: 30),
  placeholders: {
    'name': TextSpan(
          text: 'Son',
          style: TextStyle(fontWeight: FontWeight.bold),
    ),
    'my_name': TextSpan(
          text: 'Dad',
          style: TextStyle(
            color: Colors.red,
            decoration: TextDecoration.underline,
          ),
    ),
    'icon': WidgetSpan(
      child: GestureDetector(
        child: Icon(Icons.person),
        onTap: () {
          ScaffoldMessenger.of(context).showSnackBar(SnackBar(
            content: Text('Icon has been clicked'),
          ));
        },
      ),
    ),
  },
),

To escape the placeholder, prefix with \, e.g \{placeholder}:

RichTextComposer(
  'Hi \\{dad}, I am {batman}!',
  style: TextStyle(fontSize: 25),
  placeholders: {
    'batman': TextSpan(
          text: 'Batman',
          style: TextStyle(
            color: Colors.red,
            decoration: TextDecoration.underline,
          ),
    ),
  },
),

Example

Categories

Source repository

Projects using this package

No data available yet.