Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

textDirection != null assert is not null ListTile

Tags:

flutter

When using ListTile in Material widget, the flutter app is stuck on error saying "Failed assertion: line 507 pos 15 'textDirection != null' assert is not true". But the ListItem widget does not have any property as textDirection. How do I solve this?

enter image description here

enter image description here

like image 383
Nikhil Bansal Avatar asked Mar 06 '26 12:03

Nikhil Bansal


1 Answers

I saw the error, it happens when you don't have a MaterialApp or CupertinoApp as initial Widget, I suggest you to create a new project and see how Flutter creates the Widgets.

To fix your issue :

    return MaterialApp(
        home: Material(
          child: ListTile(
            ...
          ),
        ),
      ),

textDirection is not required

like image 118
diegoveloper Avatar answered Mar 09 '26 03:03

diegoveloper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!