dart - 错误 : The getter 'ltr' isn't defined for the class 'TextDirection'

标签 dart flutter

任何人都可以告诉我这个错误
谢谢 。

Text("مرحبا بالعالم",
                                textAlign: TextAlign.right,
                                style: TextStyle(
                                    color: Colors.white,
                                    fontWeight: FontWeight.bold,
                                    fontSize: 17),
                                textDirection: TextDirection.ltr,
                              ),

error: The getter 'ltr' isn't defined for the class 'TextDirection'



Error

最佳答案

我知道它的方式为时已晚,但对于任何有同样问题的人,请执行此操作

import 'dart:ui' as ui;
然后使用
textDirection: ui.TextDirection.ltr
在您的文本小部件中

关于dart - 错误 : The getter 'ltr' isn't defined for the class 'TextDirection' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55740952/

相关文章:

android - Visual Studio 代码无法检测到模拟器设备或连接的电话

dart - DART:在库上运行pub build失败,出现 “[65] There are no source directories present”

flutter - 如何在 Flutter 中格式化日期时间?删除 DateTime 中的毫秒数?

checkbox - flutter 复选框不需要的触摸空间

flutter 桌面 : Disable scrolling when hover a Container

validation - flutter TextFormField 验证显示对齐错误

Flutter - ParentDataWidget 的不正确使用

dart - 如何使用 fcm 在 flutter 中的推送通知中添加图像?

firebase - 基于firestore快照强制流读取缓存

flutter - 如何使用 flutter 本地通知删除通知 channel ?