No Directionality widget found

flutter doesn’t know whether the text is LTR or RTL, so you need to tell him the textDirection explicitly

new Text("Hello", textDirection: TextDirection.ltr)

or you can just wrap the Text with a Directionality Widget

new Directionality(
          textDirection: TextDirection.ltr,
          child: new Text('Hello')

and the purpuse of that is :

A widget that determines the ambient directionality of text and
text-direction-sensitive render objects.

And a Text widget in the scope of a MaterialApp widget does not need to be given an explicit writing direction because The default localization in the widgets and material libraries is LTR

Leave a Comment