0

this is my code:

 @override
 Widget build(BuildContext context) {
    return ListView(children: [
       Card(
          child: Row(
             children: [
                 ListTile(
                     title: Text(publicacion.title),
                    subtitle: Text(publicacion.body),
                 )
             ],
          )),
     ]);
  }

Surely it is some overflow, but I couldn't fix it, I can't find the way .. I tried to implement ListView.builder, but I wouldn't be knowing where to fit it

2 Answers2

0

Try to add your Inside Row widgets wrap it with Expanded or Flexible refer my answer here or here or here hope its helpful to you

Refer Expanded here

Try below code hope its helpful to you.

    ListView(
            shrinkWrap: true,
            children: [
              Card(
                child: Row(
                  children: [
                    Expanded(
                      child: ListTile(
                        title: Text(
                            'publicacion.titlepublicacion.titlepublicacion.titlepublicacion.titlepublicacion.titlepublicacion.title'),
                        subtitle: Text(
                            'publicacion.bodypublicacion.titlepublicacion.titlepublicacion.titlepublicacion.titlepublicacion.titlepublicacion.title'),
                      ),
                    )
                  ],
                ),
              ),
            ],
          ),

Your Result Screen-> image

Ravindra S. Patil
  • 11,757
  • 3
  • 13
  • 40
0

The Row widget is creating this problem, just remove Row Widget and it should work fine.

@override
  Widget build(BuildContext context) {
    return ListView(children: [
      Card(
          child: ListTile(
            title: Text(publicacion.title),
            subtitle: Text(publicacion.body),
          )),
    ]);
  }
Muhammad Hussain
  • 966
  • 4
  • 15