Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/ahmedalyousif/auto_direction
- Owner: AhmedAlYousif
- License: mit
- Created: 2019-05-23T10:38:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-10T18:17:57.000Z (about 1 year ago)
- Last Synced: 2024-06-20T22:38:54.593Z (8 months ago)
- Topics: dart, flutter, flutter-package, mobile
- Language: C++
- Size: 847 KB
- Stars: 20
- Watchers: 1
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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;
});
},
),
)
```