2

The Parent Widget Is Column, Column Contains the following children:

  • STACK
  • CONTAINER(CHILD: ROW)
  • ROW(CHILDREN: [GESTUREDETECTOR(child:Container), GESTUREDETECTOR(child:Container)]
  • LISTVIEW BUILDER

Wrapping this column with expanded, and then with singlechildScrollView. The result is the error!!

WHAT TO DO??

1 Answer 1

1

Wrap Column with SinglechildScrollView, for ListView.builder you need to set:

    physics: NeverScrollableScrollPhysics(),
    shrinkWrap: true,

In your case widget tree will look like this (minimal reproducible sample)

    import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SingleChildScrollView',
      home: Scaffold(
          appBar: AppBar(
            title: Text('SingleChildScrollView Example'),
          ),
          body: SingleChildScrollView(
            child: Column(
              children: [
                Stack(
                  children: [
                    Container(
                      width: 50,
                      height: 50,
                      color: Colors.cyan,
                    ),
                  ],
                ),
                Container(
                  child: Row(
                    children: [
                      GestureDetector(
                        child: Container(
                          width: 50,
                          height: 50,
                          color: Colors.green,
                        ),
                      ),
                      GestureDetector(
                        child: Container(
                          width: 50,
                          height: 50,
                          color: Colors.blue,
                        ),
                      ),
                    ],
                  ),
                ),
                ListView.builder(
                  physics: NeverScrollableScrollPhysics(),
                  shrinkWrap: true,
                  itemCount: 60,
                  itemBuilder: (context, index) => Text('Item # $index'),
                )
              ],
            ),
          )),
    );
  }
}

And it scrolls.

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

1 Comment

I couldn't get it? The column have the child lisview.builder. The entire set of widgets are the children of Column. Column is the parentwidget. I want to make the Parent Column Scrollable.

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.