2

I'd been trying to implement horizontal listview in flutter(Web). The code works fine for android but somehow scroll gets disable on web . Can anyone tell the error or improvement in the below code. I wast something like youtube app's filter widget Just like this

    return Scaffold(
    body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            SizedBox(
              height: MediaQuery.of(context).size.height * 0.1,
              child: SingleChildScrollView(
                scrollDirection: Axis.horizontal,
                child: ListView(
                    scrollDirection: Axis.horizontal,
                    shrinkWrap: true,
                    children: [
                      Card1
                      Card2
                      Card3
                      Card4
 
                    ]),
              ),....closing brackets
5
  • Also this works on dartpad but not on Android Studio's chrome(web) Commented Jun 30, 2021 at 7:46
  • 1
    I think you can remove singlechildscrollview and give a try Commented Jun 30, 2021 at 7:47
  • since the parent is singlechildscrollview, its using this to scroll.. you can either disable scrollphysics for the same or remove it . Commented Jun 30, 2021 at 8:55
  • @Muhtar I tried removing the singlechildscrollview ,but then too it wont't work. BTW thanks answering . Commented Jul 1, 2021 at 12:20
  • 1
    Does this answer your question? stackoverflow.com/a/69202112/12789200 Commented Nov 24, 2021 at 0:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.