OpenContainer animation not working in a SingleChildScrollView

Viewed 129

This is my code:

child: SingleChildScrollView(
          padding:
              const EdgeInsets.only(top: 20, bottom: 20, left: 15, right: 15),
          child: Column(
            children: <Widget>[
              OpenContainer(
                transitionType: ContainerTransitionType.fadeThrough,
                closedBuilder: (BuildContext _, VoidCallback opencontainer) {
                  return GestureDetector(...);
                },
                openBuilder: (BuildContext _, VoidCallback __) {
                  return SizedBox(
                    height: 500,
                    child: Text("Works"),
                  );
                },
              ),
...

The SingleChildScrollView is also within a container for alignment in the page. GestureDetector has an InkWell within it which has a Card.

I have the animations package installed and working, what is going wrong here?

1 Answers

Perks of being a programmer; due to going through a long process of getting widgets to work by putting them within other widgets, I just copied and pasted them into the closedBuilder.

The simple solution was to just take the Card and place it within the return statement of the closedBuilder, without its GestureDetector and InkWell (of course, both of them have onTaps as well, would make things very wonky).

Related