localized_rich_text_plus 0.0.2 copy "localized_rich_text_plus: ^0.0.2" to clipboard
localized_rich_text_plus: ^0.0.2 copied to clipboard

This package allows you to localize your RichText widget as using translateble keys

Localized RichText Plus #

Localized RichText package lets you localize your RichText.

Installation #

  1. Add the latest version of package to your pubspec.yaml (and rundart pub get):
dependencies:
  localized_rich_text_plus: ^0.0.1
  1. Import the package and use it in your Flutter App.
import 'package:localized_rich_text_plus/localized_rich_text_plus.dart';

Examples of How To Use the package #

  • default parameter - You pass your full text here
  • originalText - specific word or phrase will be changed
  • localizedText - specific word or phrase will be localized to
  • style - Custom TextStyle if necessary to add

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

class LocalizedWidget extends StatelessWidget {
  const LocalizedWidget({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return LocalizedRichText(
      const Text(
        'I have read paymentRulesText and paymentContractText, I agree.',
        style: TextStyle(
          fontSize: 18,
        ),
      ),

      richTexts: [
        LocalRichText(
          originalText: 'paymentRulesText',
          localizedText: 'the user agreement, the rules of the site',
          style: const TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.w700,
          ),
          onTap: () => {print("clicked")},
        ),
        LocalRichText(
          originalText: 'paymentContractText',
          localizedText: 'the general offer agreement',
          style: const TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.w700,
          ),
          onTap: () => {print("clicked")},
        ),
      ],
    );
  }
}

Screenshot #


Referenced from these packages
2
likes
150
pub points
64%
popularity

Publisher

verified publisherrahimli.live

This package allows you to localize your RichText widget as using translateble keys

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on localized_rich_text_plus