0

[children and padding isnt defined in listView flutter]

return ListView( padding: const EdgeInsets.all(8),

children: [ Container( height: 50, color: Colors.amber[600], child: const Center(child: Text('Entry A')), ), Container( height: 50, color: Colors.amber[500], child: const Center(child: Text('Entry B')), ), Container( height: 50, color: Colors.amber[100], child: const Center(child: Text('Entry C')), ), ], );

3
  • where's is this return? void buld(context)? Nov 25, 2021 at 18:19
  • I copiedyour code and it works fine. Are you using the listview in the buildcontext of a stateless/stateful widget?
    – Asquare17
    Nov 25, 2021 at 19:50
  • the problem was my class name was ListView when i changed name it work properly
    – h.sadig
    Nov 26, 2021 at 9:51

1 Answer 1

0

the problem was my class name was ListView when i changed name it work properly.

we must choose names that diffrent from dart flutter classes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.