1

Faced a problem, when adding SingleChildScrollView ListView.builder does not scroll. What could be the problem and how to fix it? We need to make the ListView scrollable.

body

 Widget _child(context, Size size) => Padding(
        padding: const EdgeInsets.symmetric(horizontal: 24),
        child: SingleChildScrollView(
          physics: const NeverScrollableScrollPhysics(),
          child: Column(
            children: [
              const SizedBox(height: 121),
              const BackStepWidget(text: 'My Poynts'),
              const SizedBox(height: 25),
              PoyntsList(size: size),
            ],
          ),
        ),
      );

PoyntsList

Widget build(BuildContext context) => MediaQuery.removePadding(
        context: context,
        removeTop: true,
        child: ListView.builder(
          shrinkWrap: true,
          itemCount: list.length + 1,
          itemBuilder: (context, index)...
3
  • 1
    remove this: NeverScrollableScrollPhysics() Commented Apr 15, 2022 at 12:04
  • Thanks for the help. Works. Tell me, is there a difference Expanded or Flexible? Commented Apr 15, 2022 at 12:07
  • See this to understand the difference stackoverflow.com/questions/52645944/… Commented Apr 15, 2022 at 12:09

2 Answers 2

3

Make sure to remove:

physics: const NeverScrollableScrollPhysics(),

you can read about it here : NeverScrollableScrollPhysics

Sign up to request clarification or add additional context in comments.

Comments

1

Please remove singlechildscrollview and simply wrap your PoyntsList with expanded. it will work.

2 Comments

Thanks for the help. Works. Tell me, is there a difference Expanded or Flexible?
In your case there were two scrollable widgets in same page. so you have to give neverScrollablePhysics to inner listview. and any physics to outer listview. it will also works.

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.