erluxman
erluxman

Reputation: 19385

No Directionality widget found. RichText widgets require a Directionality widget ancestor

I am trying to run the simplest possible flutter app by printing Hello World in the screen.

Following this issue, I tried both of the snippets :

void main() {
    runApp(
        new Center(
            child: new Text("Hello World!", textDirection: TextDirection.ltr)
        )
     );
}

&&

void main() {
    runApp(new Center(
      child: new Directionality(
          textDirection: TextDirection.ltr,
          child: new Text('Hello, world!'))));
}

But I get error which says :

No Directionality widget found. RichText widgets require a Directionality widget ancestor.

What am I missing?

Upvotes: 0

Views: 1492

Answers (1)

erluxman
erluxman

Reputation: 19385

It worked for me after :

Full Restart

Upvotes: 1

Related Questions