Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ahmedalyousif/auto_direction

This flutter package changes the direction of a widget from ltr direction into rtl direction and vice versa based on the language of the text provided.
https://github.com/ahmedalyousif/auto_direction

dart flutter flutter-package mobile

Last synced: about 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# auto_direction

This [widget](https://pub.dev/packages/auto_direction) 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](gif/TextField.gif)

## Getting Started

This [widget](https://pub.dev/packages/auto_direction) will wrap its child with a [`Directionality`](https://api.flutter.dev/flutter/widgets/Directionality-class.html) widget and it will decide the direction based on the provided text.

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