0

I'm working on a Flutter app that shows smart home devices in each room that looks something like this

enter image description here

When I tap on the picture of the room, I want to make the part in the red circle appear right below it but I have no idea how is this kind of animation is called.

I'm using ListView for the part in the circle and InkWell for the picture.

Thank you in advance

UPDATE After following the suggestion from the comments (thank you) I found this package https://pub.dev/packages/expandable super easy to use, very intuitive. I would recommend anyone that's trying to create this expandable card to check it out

Book Teeranai
  • 103
  • 2
  • 7
  • Should it be at the bottom of the screen... If so I would recommend a MODALBOTTOMSHEET. – king mort Jul 17 '20 at 15:34
  • It should appear right below the picture that has been tapped. Like if I tap the bedroom, the listview should appear between bedroom and kitchen. – Book Teeranai Jul 17 '20 at 15:37

2 Answers2

1

Please check this out... There are several solutions here to reaching your goal How to make Expandable card?

king mort
  • 1,423
  • 8
  • 12
1

I would suggest you put the devices list in an AnimatedContainer like that :

AnimatedContainer(
   height: isKitchenOpened ? 400 : 0,
   duration: Duration(milliseconds: 300),
   child: Placeholder(),
)

isKitchenOpened being a boolean that you toggle when tapping the kitchen picture.

You can also change the animation curve, like curve: Curves.decelerate

MickaelHrndz
  • 3,604
  • 1
  • 13
  • 23