FLUTTER ECOSYSTEM

AhmedAlYousif/auto_direction

此 Flutter 包根据提供的文本的语言,将小部件的方向从左到右(LTR)更改为右到左(RTL),反之亦然。

auto_direction 项目封面
Stars
21
Forks
23
最近推送(UTC)
2023年11月10日
项目状态
已归档
Ahmed Al Yousif GitHub avatar
GITHUB User

Ahmed Al Yousif ↗

语言C++CMakeDartHTMLCSwiftObjective-CShellJavaKotlin

技术话题

此仓库发布的插件

使用的依赖

依赖清单 3 项
  • flutter{"sdk":"flutter"}
  • intl^0.18.1
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

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;
      });
    },
  ),
)