chichi
chichi

Reputation: 3292

Flutter: SingleChildScrollView Bottom Overflow error

I have this SingleChildScrollView Widget to make Column scrollable. However, I get the overflow error. I looked up on Flutter site to find necessary input but the example is not even showing up on my screen. How can I make this widget scrollable?

 Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: AnimatedContainer(
        duration: Duration(seconds: 2),
        margin: EdgeInsets.only(top: 10),
        curve: Curves.fastOutSlowIn,
        width: 300,
        height: 500,
        color: Colors.lightBlue,
        child: Center(
          child: Column(
            children: [
              aa(),
              bb(),
              cc(),
              dd(),
            ],
          ),
        ),
      ),
    );
  }

Upvotes: 0

Views: 509

Answers (1)

pasty
pasty

Reputation: 420

It would be helpful to know constraints/sizes of these widgets aa(), bb(), cc(), dd() and also see build() method to better suggest you a solution.

But i think the issue is that you explicitly set height of AnimatedContainer to be 500 pixels, and children of these parent are taller than 500px and that's why you get overflow error. Try to not to set static heights like that. If you delete the height field i think AnimatedContainer will adjust to take such space that you won't get overflow error.

Upvotes: 1

Related Questions