any one can tell me about this error thx .
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
Ltr. Always sets the text direction to be Left to Right. TextDirection. Rtl. Always sets the text direction to be Right to Left.
textDirection: textDirection is used to specify the direction of the text inside a Text Widget say ltr (left-to-right) or rtl (right to left). ltr is the default text direction. rtl can be used if you are building apps that supports languages like Arabic or Hebrew.
I had the same issue and it confused me because i wasn't using the intl
package.. but since i used the easy_localization
package and this one itself uses the intl
package.. i figured it out that i have to hide the TextDirection
class from it:
import 'package:easy_localization/easy_localization.dart' hide TextDirection;
i hope this could help anyone out there :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With