Skip to content

ShawnAlisson/auto_rtl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

auto_rtl

Simple package to change the direction of TextField, Text,... to RTL/LTR based on the text, and set default direction for them.!

Built With

  • Flutter
  • Dart

Getting Started

  1. Add auto_rtl to pubspec.yaml of your project

     [auto_rtl]:
       git:
         url: https://github.com/ShawnAlisson/auto_rtl
  2. Wrap your widget with this

...
String yourText = "";
...
AutoRTL(
  content: yourText,
  defaultRTL: true
  //For LTR, it should be false, or it can be based on the language.
  //For example, defaultRTL: Localizations.localeOf(context).toString() == "fa" ? true : false

  child: TextField(
    onChanged: (value){
      setState(() {
        yourText = value;
      });
    },
  ),
)

(back to top)

About

Simple Flutter package to change the direction of TextField, Text,... to RTL/LTR based on the text, and set default direction for them.!

Topics

Resources

License

Stars

Watchers

Forks

Languages