Search packages, repositories and app categories

auto_direction cover
Package detailsv0.0.7

auto_direction

This package changes the direction of a widget from ltr direction into rtl direction and vice versa based on the language of the text provided.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
1.9K
Likes
88
Pub points
40

Install package

flutter pub add auto_direction

Package Overview

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

The auto_direction package automatically adjusts the text direction of widgets in Flutter applications based on the detected language, switching between left-to-right (LTR) and right-to-left (RTL) layouts. It simplifies internationalization by dynamically adapting UI direction without manual intervention, ensuring proper rendering for languages like Arabic, Hebrew, and others that use RTL scripts. The package integrates seamlessly into apps targeting multilingual audiences.

Use cases

  • Dynamic UI layout adaptation
  • Multilingual app support
  • RTL/LTR text direction switching
  • Internationalized user interfaces
  • Automatic language-based layout adjustment

Key features

  • Language-based direction detection
  • Automatic LTR/RTL switching
  • Seamless integration with Flutter widgets
  • Support for multiple platforms
  • Minimal configuration required

Suitable for

  • Apps targeting global audiences
  • Developers using Flutter for internationalization
  • Projects requiring dynamic text direction
  • UIs with mixed language content
  • Web and mobile apps with RTL language support

Considerations

  • Requires accurate language detection
  • May need additional logic for complex layouts
  • Not suitable for static directional designs
  • Depends on correct locale setup
  • Limited to text direction changes, not full RTL themes

Original README

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

auto_direction

This widget changes the direction of a widget from ltr direction into rtl direction and vice versa based on the language of the text provided.

Auto RTL on a TextField

Getting Started

This widget will wrap its child with a Directionality widget and it will decide the direction based on the provided text.

...
String text = "";
...
AutoDirection(
  text: text,
  child: TextField(
    onChanged: (str){
      setState(() {
        text = str;
      });
    },
  ),
)

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package