1

I have a question, how do I make a image on top of a listview and still be able to scroll on the listview? Like scroll though the image, so the image is not moving. When I stack them with 'stack widget' I still can't scroll, only in the parts of the scrollview that dosn't have an image on top of it. Please help me, this is like a big part of my app that i've been developing for 6 weeks now, and if I can't make it work, my app is kinda done for it!

Here's an example:

Stack(
children: <Widget>[
  ListView(
    controller: scrollController,
    children: <Widget>[
      Container(
       child: Text('widget 1'),
      ),
      Container(
       child: Text('widget 2'),
      ),
      Container(
       child: Text('widget 3'),
      ),
     ],
    ),
    Image.asset('assets/myImage.png'),
 ],
),

1 Answer 1

1

You can wrap the image with an IgnorePointer widget:

Stack(
        children: <Widget>[
          ListView(
            controller: scrollController,
            children: <Widget>[
              Container(
                child: Text('widget 1'),
              ),
              Container(
                child: Text('widget 2'),
              ),
              Container(
                child: Text('widget 3'),
              ),
            ],
          ),
          IgnorePointer(child: Image.asset('assets/myImage.png')),
        ],
      ),
Sign up to request clarification or add additional context in comments.

1 Comment

Thx a lot, helped a ton :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.