skip to Main Content

so i want to scroll horizontally and this horizontal widget are also should be able to be scrolled with the whole screen vertically

i get errors while using the horizontal ListView in a parent vertical ListView

2

Answers


  1. You need to add below property in Listview :

    scrollDirection: Axis.horizontal,
    
    Login or Signup to reply.
  2. ListView(
      children: [
        SizedBox(
          height: 70, // Height of horizontal list view.
          child: ListView(
            scrollDirection: Axis.horizontal,
            children: const [
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
              Padding(
                padding: EdgeInsets.all(20),
                child: Text("some Widgets"),
              ),
            ],
          ),
        ),
      ],
    ),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search